public inbox for linux-msdos@vger.kernel.org
 help / color / mirror / Atom feed
From: Stas Sergeev <stsp@aknet.ru>
To: linux-msdos@vger.kernel.org
Subject: Re: What to expect in dosemu-1.2?
Date: Wed, 23 Jul 2003 20:21:48 +0400	[thread overview]
Message-ID: <3F1EB61C.3070100@aknet.ru> (raw)

[-- Attachment #1: Type: text/plain, Size: 590 bytes --]

Hello.

Justin Zygmont wrote:
>> - Client-server approach for port I/O, which allows 
> I wonder if this is why there is a lock file problem with
> a modem now?
No, this has nothing to do with locks.
However there is a bug in a serial code
which, but only in case open() fails,
prints a misleading message that the device
is already locked, and leaves a stale lock
file.
The fix is attached. This may not be the
problem you see however. I have no idea
what you see actually, as you have provided
no details. But as I already have a fix to
something similar - try it and maybe it will
help.

[-- Attachment #2: ser_lock.diff --]
[-- Type: text/plain, Size: 583 bytes --]

--- src/base/serial/ser_init.c	Sun Jul 20 17:43:22 2003
+++ src/base/serial/ser_init.c	Wed Jul 23 07:34:57 2003
@@ -245,6 +245,14 @@
   }
   
   com[num].fd = RPT_SYSCALL(open(com[num].dev, O_RDWR | O_NONBLOCK));
+  if (com[num].fd < 0) {
+    error("SERIAL: Unable to open device %s: %s\n",
+      com[num].dev, strerror(errno));
+    if (tty_lock(com[num].dev, 0) >= 0)   		/* Unlock port */
+      com[num].dev_locked = FALSE;
+    com[num].fd = -2; // disable permanently
+    return -1;
+  }
   RPT_SYSCALL(tcgetattr(com[num].fd, &com[num].oldset));
   return (com[num].fd);
 }

             reply	other threads:[~2003-07-23 16:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-23 16:21 Stas Sergeev [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-07-22 18:00 What to expect in dosemu-1.2? Stas Sergeev
2003-07-22 18:49 ` Justin Zygmont
2003-07-22 10:23 Samium Gromoff
2003-07-22 16:05 ` Justin Zygmont

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F1EB61C.3070100@aknet.ru \
    --to=stsp@aknet.ru \
    --cc=linux-msdos@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox