diff options
| author | Paul Eggert | 2018-11-22 09:32:33 -0800 |
|---|---|---|
| committer | Paul Eggert | 2018-11-22 09:33:00 -0800 |
| commit | 7a85753d35b9b010baed7e297f72b308318c3b67 (patch) | |
| tree | 1ed0cd16a2ee984f8469469e2f75ec2f32ccf58d /lib-src | |
| parent | 5773470ff3a85640fbaeab1a88edc3fa395184bd (diff) | |
| download | emacs-7a85753d35b9b010baed7e297f72b308318c3b67.tar.gz emacs-7a85753d35b9b010baed7e297f72b308318c3b67.zip | |
emacsclient: coalesce WINDOWSNT-specific code
* lib-src/emacsclient.c (sock_err_message) [WINDOWSNT]:
Do nothing if w32_window_app () && alternate_editor.
Both callers changed.
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/emacsclient.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index e6eb3c74cf7..6f2fb20ae52 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c | |||
| @@ -753,14 +753,17 @@ enum { AUTH_KEY_LENGTH = 64 }; | |||
| 753 | /* Socket used to communicate with the Emacs server process. */ | 753 | /* Socket used to communicate with the Emacs server process. */ |
| 754 | static HSOCKET emacs_socket = 0; | 754 | static HSOCKET emacs_socket = 0; |
| 755 | 755 | ||
| 756 | /* On Windows, the socket library was historically separate from the | ||
| 757 | standard C library, so errors are handled differently. */ | ||
| 758 | |||
| 759 | static void | 756 | static void |
| 760 | sock_err_message (const char *function_name) | 757 | sock_err_message (const char *function_name) |
| 761 | { | 758 | { |
| 762 | # ifdef WINDOWSNT | 759 | # ifdef WINDOWSNT |
| 763 | char* msg = NULL; | 760 | /* On Windows, the socket library was historically separate from the |
| 761 | standard C library, so errors are handled differently. */ | ||
| 762 | |||
| 763 | if (w32_window_app () && alternate_editor) | ||
| 764 | return; | ||
| 765 | |||
| 766 | char *msg = NULL; | ||
| 764 | 767 | ||
| 765 | FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | 768 | FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM |
| 766 | | FORMAT_MESSAGE_ALLOCATE_BUFFER | 769 | | FORMAT_MESSAGE_ALLOCATE_BUFFER |
| @@ -1000,9 +1003,6 @@ set_tcp_socket (const char *local_server_file) | |||
| 1000 | yet; popping out a modal dialog at this stage would make -a | 1003 | yet; popping out a modal dialog at this stage would make -a |
| 1001 | option totally useless for emacsclientw -- the user will | 1004 | option totally useless for emacsclientw -- the user will |
| 1002 | still get an error message if the alternate editor fails. */ | 1005 | still get an error message if the alternate editor fails. */ |
| 1003 | # ifdef WINDOWSNT | ||
| 1004 | if(!(w32_window_app () && alternate_editor)) | ||
| 1005 | # endif | ||
| 1006 | sock_err_message ("socket"); | 1006 | sock_err_message ("socket"); |
| 1007 | return INVALID_SOCKET; | 1007 | return INVALID_SOCKET; |
| 1008 | } | 1008 | } |
| @@ -1010,9 +1010,6 @@ set_tcp_socket (const char *local_server_file) | |||
| 1010 | /* Set up the socket. */ | 1010 | /* Set up the socket. */ |
| 1011 | if (connect (s, &server.sa, sizeof server.in) != 0) | 1011 | if (connect (s, &server.sa, sizeof server.in) != 0) |
| 1012 | { | 1012 | { |
| 1013 | # ifdef WINDOWSNT | ||
| 1014 | if(!(w32_window_app () && alternate_editor)) | ||
| 1015 | # endif | ||
| 1016 | sock_err_message ("connect"); | 1013 | sock_err_message ("connect"); |
| 1017 | return INVALID_SOCKET; | 1014 | return INVALID_SOCKET; |
| 1018 | } | 1015 | } |