[minicom/f14/master] fixed crashing on device reconnecting (#678812)

Jan Görig jgorig at fedoraproject.org
Thu Feb 24 11:21:57 UTC 2011


commit 265dc337ee8b614fad320aa639324de3b212468b
Author: Jan Görig <jgorig at redhat.com>
Date:   Thu Feb 24 12:20:23 2011 +0100

    fixed crashing on device reconnecting (#678812)

 minicom-2.5-rh.patch |   27 +++++++++++++++------------
 minicom.spec         |    5 ++++-
 2 files changed, 19 insertions(+), 13 deletions(-)
---
diff --git a/minicom-2.5-rh.patch b/minicom-2.5-rh.patch
index 474b842..fcfe035 100644
--- a/minicom-2.5-rh.patch
+++ b/minicom-2.5-rh.patch
@@ -26,7 +26,7 @@ index bc4db89..8e68e2c 100644
    /* First see if the lock file directory is present. */
    if (P_LOCK[0] && stat(P_LOCK, &stt) == 0) {
  
-@@ -215,6 +221,44 @@ int open_term(int doinit, int show_win_on_error, int no_msgs)
+@@ -215,6 +221,47 @@ int open_term(int doinit, int show_win_on_error, int no_msgs)
    if (doinit > 0)
      lockfile_create();
  
@@ -40,21 +40,24 @@ index bc4db89..8e68e2c 100644
 +        rc = 0;
 +      } else {
 +        rc = 1;
-+        fprintf(stderr, _("File %s is not a socket.\n"),
++        if (!no_msgs)
++          fprintf(stderr, _("File %s is not a socket.\n"),
 +                dial_tty+strlen(SOCKET_PREFIX));
 +      }
 +    } else {
 +#endif
 +      rc = ttylock(dial_tty);
-+      if (rc < 0) {
-+        if (access(dial_tty, W_OK) == -1)
-+          fprintf(stderr, _("Device %s access failed: %s.\n"),
-+                  dial_tty, strerror(errno));
-+        else
-+          fprintf(stderr, _("Device %s lock failed: %s.\n"),
-+                  dial_tty, strerror(-rc));
-+      } else if (rc > 0) {
-+        fprintf(stderr, _("Device %s is locked.\n"), dial_tty);
++      if(!no_msgs) {
++        if (rc < 0) {
++          if (access(dial_tty, W_OK) == -1)
++            fprintf(stderr, _("Device %s access failed: %s.\n"),
++                    dial_tty, strerror(errno));
++          else
++            fprintf(stderr, _("Device %s lock failed: %s.\n"),
++                    dial_tty, strerror(-rc));
++        } else if (rc > 0) {
++          fprintf(stderr, _("Device %s is locked.\n"), dial_tty);
++        }
 +      }
 +#ifdef USE_SOCKET
 +    }
@@ -62,7 +65,7 @@ index bc4db89..8e68e2c 100644
 +    if (rc == 0) {
 +      snprintf(lockfile, sizeof(lockfile), "%s", dial_tty);
 +    } else {
-+      if (stdwin) mc_wclose(stdwin, 1);
++      if (!no_msgs && stdwin) mc_wclose(stdwin, 1);
 +      return(-1);
 +    }
 +  }
diff --git a/minicom.spec b/minicom.spec
index 4f1a803..2e4fa52 100644
--- a/minicom.spec
+++ b/minicom.spec
@@ -1,7 +1,7 @@
 Summary: A text-based modem control and terminal emulation program
 Name: minicom
 Version: 2.5
-Release: 2%{?dist}
+Release: 3%{?dist}
 URL: http://alioth.debian.org/projects/minicom/
 License: GPLv2+
 Group: Applications/Communications
@@ -58,6 +58,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man1/*
 
 %changelog
+* Thu Feb 24 2011 Jan Görig <jgorig at redhat.com> 2.5-3
+- fixed crashing on device reconnecting (#678812)
+
 * Wed Feb 09 2011 Jan Görig <jgorig at redhat.com> 2.5-2
 - fixed crashing on non-readable directory (#675400)
 - fixed typos in minicom and runscript manpages (#675453,#675456)


More information about the scm-commits mailing list