diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2011-02-25 15:39:18 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2011-02-25 15:39:18 -0800 |
commit | 7e6bb4c94c9b4d78d9e626f32fc930cd76169e76 (patch) | |
tree | 90eb3a2b97034d79c7c8990b240fc6a9d3cb8f24 /lib-src | |
parent | b0bbc07d9a136869d1d9acfdd8e14674515eb196 (diff) | |
download | emacs-7e6bb4c94c9b4d78d9e626f32fc930cd76169e76.tar.gz |
* emacsclient.c (main): Avoid dangling 'if'.
Diffstat (limited to 'lib-src')
-rw-r--r-- | lib-src/ChangeLog | 2 | ||||
-rw-r--r-- | lib-src/emacsclient.c | 30 |
2 files changed, 17 insertions, 15 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 5b8033d2aec..d1203b2ff96 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,5 +1,7 @@ 2011-02-25 Paul Eggert <eggert@cs.ucla.edu> + * emacsclient.c (main): Avoid dangling 'if'. + * emacsclient.c: Redo local variables to avoid shadowing problems. (message, socket_status, start_daemon_and_retry_set_socket): Rename locals. diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 070d6370714..b0087c124ec 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -1543,21 +1543,21 @@ main (int argc, char **argv) null_server_file = (server_file == NULL); } - if ((emacs_socket = set_socket (alternate_editor - || start_daemon_if_needed)) == INVALID_SOCKET) - if (start_daemon_if_needed) - { - /* Reset socket_name and server_file if they were NULL - before the set_socket call. */ - if (null_socket_name) - socket_name = NULL; - if (null_server_file) - server_file = NULL; - - start_daemon_and_retry_set_socket (); - } - else - fail (); + emacs_socket = set_socket (alternate_editor || start_daemon_if_needed); + if (emacs_socket == INVALID_SOCKET) + { + if (! start_daemon_if_needed) + fail (); + + /* Reset socket_name and server_file if they were NULL + before the set_socket call. */ + if (null_socket_name) + socket_name = NULL; + if (null_server_file) + server_file = NULL; + + start_daemon_and_retry_set_socket (); + } cwd = get_current_dir_name (); if (cwd == 0) |