|
|
9ace98 |
diff -r 7bc59ff7fd31 -r 60a0efeec606 ChangeLog
|
|
|
9ace98 |
--- a/ChangeLog Thu Feb 07 20:59:16 2013 +0100
|
|
|
9ace98 |
+++ b/ChangeLog Thu Feb 07 21:00:08 2013 +0100
|
|
|
9ace98 |
@@ -1,3 +1,9 @@
|
|
|
9ace98 |
+2013-02-07 Adam Lackorzynski <adam@os.inf.tu-dresden.de>
|
|
|
9ace98 |
+
|
|
|
9ace98 |
+ * src/main.c, src/minicom.h, src/updown.c:
|
|
|
9ace98 |
+ [#314018] [PATCH] Disabling lockfile warnings when the
|
|
|
9ace98 |
+ device disappears (ttyUSB hot-unplug), by Jaromir Capik
|
|
|
9ace98 |
+
|
|
|
9ace98 |
2013-02-06 Adam Lackorzynski <adam@os.inf.tu-dresden.de>
|
|
|
9ace98 |
|
|
|
9ace98 |
* NEWS: Release 2.6.2
|
|
|
9ace98 |
diff -r 7bc59ff7fd31 -r 60a0efeec606 src/main.c
|
|
|
9ace98 |
--- a/src/main.c Thu Feb 07 20:59:16 2013 +0100
|
|
|
9ace98 |
+++ b/src/main.c Thu Feb 07 21:00:08 2013 +0100
|
|
|
9ace98 |
@@ -225,7 +225,7 @@
|
|
|
9ace98 |
}
|
|
|
9ace98 |
#endif
|
|
|
9ace98 |
|
|
|
9ace98 |
- if (doinit > 0 && lockfile_create() != 0)
|
|
|
9ace98 |
+ if (doinit > 0 && lockfile_create(no_msgs) != 0)
|
|
|
9ace98 |
return -1;
|
|
|
9ace98 |
|
|
|
9ace98 |
nolock:
|
|
|
9ace98 |
diff -r 7bc59ff7fd31 -r 60a0efeec606 src/minicom.h
|
|
|
9ace98 |
--- a/src/minicom.h Thu Feb 07 20:59:16 2013 +0100
|
|
|
9ace98 |
+++ b/src/minicom.h Thu Feb 07 21:00:08 2013 +0100
|
|
|
9ace98 |
@@ -301,7 +301,7 @@
|
|
|
9ace98 |
void domacros(void);
|
|
|
9ace98 |
|
|
|
9ace98 |
|
|
|
9ace98 |
-int lockfile_create(void);
|
|
|
9ace98 |
+int lockfile_create(int no_msgs);
|
|
|
9ace98 |
void lockfile_remove(void);
|
|
|
9ace98 |
|
|
|
9ace98 |
|
|
|
9ace98 |
diff -r 7bc59ff7fd31 -r 60a0efeec606 src/updown.c
|
|
|
9ace98 |
--- a/src/updown.c Thu Feb 07 20:59:16 2013 +0100
|
|
|
9ace98 |
+++ b/src/updown.c Thu Feb 07 21:00:08 2013 +0100
|
|
|
9ace98 |
@@ -413,7 +413,7 @@
|
|
|
9ace98 |
if (win == (WIN *)0)
|
|
|
9ace98 |
mc_wreturn();
|
|
|
9ace98 |
|
|
|
9ace98 |
- lockfile_create();
|
|
|
9ace98 |
+ lockfile_create(0);
|
|
|
9ace98 |
|
|
|
9ace98 |
/* MARK updated 02/17/94 - Flush modem port before displaying READY msg */
|
|
|
9ace98 |
/* because a BBS often displays menu text right after a download, and we */
|
|
|
9ace98 |
@@ -459,7 +459,7 @@
|
|
|
9ace98 |
#endif
|
|
|
9ace98 |
}
|
|
|
9ace98 |
|
|
|
9ace98 |
-int lockfile_create(void)
|
|
|
9ace98 |
+int lockfile_create(int no_msgs)
|
|
|
9ace98 |
{
|
|
|
9ace98 |
int n;
|
|
|
9ace98 |
|
|
|
9ace98 |
@@ -474,25 +474,29 @@
|
|
|
9ace98 |
n = umask(022);
|
|
|
9ace98 |
/* Create lockfile compatible with UUCP-1.2 */
|
|
|
9ace98 |
if ((fd = open(lockfile, O_WRONLY | O_CREAT | O_EXCL, 0666)) < 0) {
|
|
|
9ace98 |
- werror(_("Cannot create lockfile!"));
|
|
|
9ace98 |
+ if (!no_msgs)
|
|
|
9ace98 |
+ werror(_("Cannot create lockfile!"));
|
|
|
9ace98 |
} else {
|
|
|
9ace98 |
// FHS format:
|
|
|
9ace98 |
char buf[12];
|
|
|
9ace98 |
snprintf(buf, sizeof(buf), "%10d\n", getpid());
|
|
|
9ace98 |
buf[sizeof(buf) - 1] = 0;
|
|
|
9ace98 |
if (write(fd, buf, strlen(buf)) < (ssize_t)strlen(buf))
|
|
|
9ace98 |
- fprintf(stderr, _("Failed to write lockfile %s\n"), lockfile);
|
|
|
9ace98 |
+ if (!no_msgs)
|
|
|
9ace98 |
+ fprintf(stderr, _("Failed to write lockfile %s\n"), lockfile);
|
|
|
9ace98 |
close(fd);
|
|
|
9ace98 |
}
|
|
|
9ace98 |
umask(n);
|
|
|
9ace98 |
return 0;
|
|
|
9ace98 |
#else
|
|
|
9ace98 |
n = ttylock(dial_tty);
|
|
|
9ace98 |
- if (n < 0) {
|
|
|
9ace98 |
- fprintf(stderr, _("Cannot create lockfile for %s: %s\n"), dial_tty, strerror(-n));
|
|
|
9ace98 |
- } else if (n > 0) {
|
|
|
9ace98 |
- fprintf(stderr, _("Device %s is locked.\n"), dial_tty);
|
|
|
9ace98 |
- }
|
|
|
9ace98 |
+ if (!no_msgs)
|
|
|
9ace98 |
+ {
|
|
|
9ace98 |
+ if (n < 0)
|
|
|
9ace98 |
+ fprintf(stderr, _("Cannot create lockfile for %s: %s\n"), dial_tty, strerror(-n));
|
|
|
9ace98 |
+ else if (n > 0)
|
|
|
9ace98 |
+ fprintf(stderr, _("Device %s is locked.\n"), dial_tty);
|
|
|
9ace98 |
+ }
|
|
|
9ace98 |
return n;
|
|
|
9ace98 |
#endif
|
|
|
9ace98 |
}
|
|
|
9ace98 |
@@ -546,7 +550,7 @@
|
|
|
9ace98 |
mc_wreturn();
|
|
|
9ace98 |
|
|
|
9ace98 |
/* Re-create lockfile */
|
|
|
9ace98 |
- lockfile_create();
|
|
|
9ace98 |
+ lockfile_create(0);
|
|
|
9ace98 |
|
|
|
9ace98 |
m_flush(portfd);
|
|
|
9ace98 |
port_init();
|