emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs lib-src/ChangeLog lib-src/emacsclient.c l...


From: Dan Nicolaescu
Subject: [Emacs-diffs] emacs lib-src/ChangeLog lib-src/emacsclient.c l...
Date: Thu, 18 Dec 2008 08:48:32 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Dan Nicolaescu <dann>   08/12/18 08:48:31

Modified files:
        lib-src        : ChangeLog emacsclient.c 
        lisp           : ChangeLog startup.el 
        src            : ChangeLog emacs.c 

Log message:
        * emacs.c (main): Print and error and exit when no data is read
        from the pipe.
        
        * startup.el (command-line): Do not mention the server name in
        case the user has not mentioned it, print a more explicit message.
        
        * emacsclient.c (start_daemon_and_retry_set_socket): Improve error
        checking.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lib-src/ChangeLog?cvsroot=emacs&r1=2.508&r2=2.509
http://cvs.savannah.gnu.org/viewcvs/emacs/lib-src/emacsclient.c?cvsroot=emacs&r1=1.151&r2=1.152
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.14958&r2=1.14959
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/startup.el?cvsroot=emacs&r1=1.524&r2=1.525
http://cvs.savannah.gnu.org/viewcvs/emacs/src/ChangeLog?cvsroot=emacs&r1=1.7204&r2=1.7205
http://cvs.savannah.gnu.org/viewcvs/emacs/src/emacs.c?cvsroot=emacs&r1=1.456&r2=1.457

Patches:
Index: lib-src/ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/lib-src/ChangeLog,v
retrieving revision 2.508
retrieving revision 2.509
diff -u -b -r2.508 -r2.509
--- lib-src/ChangeLog   17 Dec 2008 15:25:54 -0000      2.508
+++ lib-src/ChangeLog   18 Dec 2008 08:48:26 -0000      2.509
@@ -1,3 +1,8 @@
+2008-12-18  Dan Nicolaescu  <address@hidden>
+
+       * emacsclient.c (start_daemon_and_retry_set_socket): Improve error
+       checking.
+
 2008-12-14  Dan Nicolaescu  <address@hidden>
 
        * emacsclient.c: Include syswait.h instead of sys/types.h.

Index: lib-src/emacsclient.c
===================================================================
RCS file: /cvsroot/emacs/emacs/lib-src/emacsclient.c,v
retrieving revision 1.151
retrieving revision 1.152
diff -u -b -r1.151 -r1.152
--- lib-src/emacsclient.c       14 Dec 2008 03:23:43 -0000      1.151
+++ lib-src/emacsclient.c       18 Dec 2008 08:48:27 -0000      1.152
@@ -1433,23 +1433,31 @@
 #ifndef WINDOWSNT
   pid_t dpid;
   int status;
-  pid_t p;
 
   dpid = fork ();
 
   if (dpid > 0)
     {
-      p = waitpid (dpid, &status, WUNTRACED | WCONTINUED);
+      pid_t w;
+      w = waitpid (dpid, &status, WUNTRACED | WCONTINUED);
 
-      /* Try connecting again, the daemon should have started by
-        now.  */
-      message (TRUE, "daemon should have started, trying to connect again\n", 
dpid);
+      if ((w == -1) || !WIFEXITED (status) || WEXITSTATUS(status))
+       {
+         message (TRUE, "Error: Could not start the Emacs daemon\n");
+         exit (EXIT_FAILURE);
+       }
+
+      /* Try connecting, the daemon should have started by now.  */
+      message (TRUE, "Emacs daemon should have started, trying to connect 
again\n");
       if ((emacs_socket = set_socket (1)) == INVALID_SOCKET)
-       message (TRUE, "Cannot connect even after starting the daemon\n");
+       {
+         message (TRUE, "Error: Cannot connect even after starting the Emacs 
daemon\n");
+         exit (EXIT_FAILURE);
+       }
     }
   else if (dpid < 0)
     {
-      fprintf (stderr, "Cannot fork!\n");
+      fprintf (stderr, "Error: Cannot fork!\n");
       exit (1);
     }
   else

Index: lisp/ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.14958
retrieving revision 1.14959
diff -u -b -r1.14958 -r1.14959
--- lisp/ChangeLog      18 Dec 2008 08:27:37 -0000      1.14958
+++ lisp/ChangeLog      18 Dec 2008 08:48:27 -0000      1.14959
@@ -1,5 +1,8 @@
 2008-12-18  Dan Nicolaescu  <address@hidden>
 
+       * startup.el (command-line): Do not mention the server name in
+       case the user has not mentioned it, print a more explicit message.
+
        * vc-dir.el (vc-dir-at-event): Rename from vc-at-event.  Change
        all callers.
 

Index: lisp/startup.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/startup.el,v
retrieving revision 1.524
retrieving revision 1.525
diff -u -b -r1.524 -r1.525
--- lisp/startup.el     16 Dec 2008 21:23:08 -0000      1.524
+++ lisp/startup.el     18 Dec 2008 08:48:29 -0000      1.525
@@ -1223,7 +1223,11 @@
       (server-start)
       (if server-process
          (daemon-initialized)
-       (message "Unable to start daemon: Emacs server named %S already 
running" server-name)
+       (if (stringp dn)
+           (message
+            "Unable to start daemon: Emacs server named %S already running"
+            server-name)
+         (message "Unable to start the daemon.\nAnother instance of Emacs is 
running the server, either as daemon or interactively.\nYou can use emacsclient 
to connect to that Emacs process."))
        (kill-emacs 1))))
 
   ;; Run emacs-session-restore (session management) if started by

Index: src/ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/src/ChangeLog,v
retrieving revision 1.7204
retrieving revision 1.7205
diff -u -b -r1.7204 -r1.7205
--- src/ChangeLog       17 Dec 2008 15:25:56 -0000      1.7204
+++ src/ChangeLog       18 Dec 2008 08:48:30 -0000      1.7205
@@ -1,3 +1,8 @@
+2008-12-18  Dan Nicolaescu  <address@hidden>
+
+       * emacs.c (main): Print and error and exit when no data is read
+       from the pipe.
+
 2008-12-17  Jason Rumney  <address@hidden>
 
        * w32font.c (w32font_has_char): Always return -1.

Index: src/emacs.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/emacs.c,v
retrieving revision 1.456
retrieving revision 1.457
diff -u -b -r1.456 -r1.457
--- src/emacs.c 8 Dec 2008 16:22:40 -0000       1.456
+++ src/emacs.c 18 Dec 2008 08:48:31 -0000      1.457
@@ -1129,6 +1129,11 @@
              fprintf (stderr, "Error reading status from child\n");
              exit (1);
            }
+         else if (retval == 0)
+           {
+             fprintf (stderr, "Error: server did not start correctly\n");
+             exit (1);
+           }
 
          close (daemon_pipe[0]);
          exit (0);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]