emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 7a85753: emacsclient: coalesce WINDOWSNT-specific c


From: Paul Eggert
Subject: [Emacs-diffs] master 7a85753: emacsclient: coalesce WINDOWSNT-specific code
Date: Thu, 22 Nov 2018 12:33:05 -0500 (EST)

branch: master
commit 7a85753d35b9b010baed7e297f72b308318c3b67
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    emacsclient: coalesce WINDOWSNT-specific code
    
    * lib-src/emacsclient.c (sock_err_message) [WINDOWSNT]:
    Do nothing if w32_window_app () && alternate_editor.
    Both callers changed.
---
 lib-src/emacsclient.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index e6eb3c7..6f2fb20 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -753,14 +753,17 @@ enum { AUTH_KEY_LENGTH = 64 };
 /* Socket used to communicate with the Emacs server process.  */
 static HSOCKET emacs_socket = 0;
 
-/* On Windows, the socket library was historically separate from the
-   standard C library, so errors are handled differently.  */
-
 static void
 sock_err_message (const char *function_name)
 {
 # ifdef WINDOWSNT
-  char* msg = NULL;
+  /* On Windows, the socket library was historically separate from the
+     standard C library, so errors are handled differently.  */
+
+  if (w32_window_app () && alternate_editor)
+    return;
+
+  char *msg = NULL;
 
   FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM
                  | FORMAT_MESSAGE_ALLOCATE_BUFFER
@@ -1000,9 +1003,6 @@ set_tcp_socket (const char *local_server_file)
         yet; popping out a modal dialog at this stage would make -a
         option totally useless for emacsclientw -- the user will
         still get an error message if the alternate editor fails.  */
-# ifdef WINDOWSNT
-      if(!(w32_window_app () && alternate_editor))
-# endif
       sock_err_message ("socket");
       return INVALID_SOCKET;
     }
@@ -1010,9 +1010,6 @@ set_tcp_socket (const char *local_server_file)
   /* Set up the socket.  */
   if (connect (s, &server.sa, sizeof server.in) != 0)
     {
-# ifdef WINDOWSNT
-      if(!(w32_window_app () && alternate_editor))
-# endif
       sock_err_message ("connect");
       return INVALID_SOCKET;
     }



reply via email to

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