Justin Zygmont wrote:
- Client-server approach for port I/O, which allowsI 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.
--- 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);
}
