diff options
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/ChangeLog.multi-tty | 5 | ||||
| -rw-r--r-- | lib-src/emacsclient.c | 15 |
2 files changed, 12 insertions, 8 deletions
diff --git a/lib-src/ChangeLog.multi-tty b/lib-src/ChangeLog.multi-tty index 21862e5ed32..0e50b7c61a8 100644 --- a/lib-src/ChangeLog.multi-tty +++ b/lib-src/ChangeLog.multi-tty | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2007-05-16 Jason Rumney <jasonr@gnu.org> | ||
| 2 | |||
| 3 | * emacsclient.c: (emacs_socket): Rename from s. | ||
| 4 | Move definition below includes it depends on. | ||
| 5 | |||
| 1 | 2007-05-16 Dan Nicolaescu <dann@ics.uci.edu> | 6 | 2007-05-16 Dan Nicolaescu <dann@ics.uci.edu> |
| 2 | 7 | ||
| 3 | * emacsclient.c (s): Restore. | 8 | * emacsclient.c (s): Restore. |
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index cf03430e9c5..a8d3257cde0 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c | |||
| @@ -108,8 +108,8 @@ char *(getcwd) (); | |||
| 108 | #define VERSION "unspecified" | 108 | #define VERSION "unspecified" |
| 109 | #endif | 109 | #endif |
| 110 | 110 | ||
| 111 | #define SEND_STRING(data) (send_to_emacs (s, (data))) | 111 | #define SEND_STRING(data) (send_to_emacs (emacs_socket, (data))) |
| 112 | #define SEND_QUOTED(data) (quote_argument (s, (data))) | 112 | #define SEND_QUOTED(data) (quote_argument (emacs_socket, (data))) |
| 113 | 113 | ||
| 114 | #ifndef EXIT_SUCCESS | 114 | #ifndef EXIT_SUCCESS |
| 115 | #define EXIT_SUCCESS 0 | 115 | #define EXIT_SUCCESS 0 |
| @@ -171,9 +171,6 @@ char *server_file = NULL; | |||
| 171 | /* PID of the Emacs server process. */ | 171 | /* PID of the Emacs server process. */ |
| 172 | int emacs_pid = 0; | 172 | int emacs_pid = 0; |
| 173 | 173 | ||
| 174 | /* Socket used to communicate with the Emacs server process. */ | ||
| 175 | HSOCKET s; | ||
| 176 | |||
| 177 | void print_help_and_exit () NO_RETURN; | 174 | void print_help_and_exit () NO_RETURN; |
| 178 | 175 | ||
| 179 | struct option longopts[] = | 176 | struct option longopts[] = |
| @@ -567,6 +564,8 @@ extern int errno; | |||
| 567 | /* Buffer to accumulate data to send in TCP connections. */ | 564 | /* Buffer to accumulate data to send in TCP connections. */ |
| 568 | char send_buffer[SEND_BUFFER_SIZE + 1]; | 565 | char send_buffer[SEND_BUFFER_SIZE + 1]; |
| 569 | int sblen = 0; /* Fill pointer for the send buffer. */ | 566 | int sblen = 0; /* Fill pointer for the send buffer. */ |
| 567 | /* Socket used to communicate with the Emacs server process. */ | ||
| 568 | HSOCKET emacs_socket = 0; | ||
| 570 | 569 | ||
| 571 | /* Let's send the data to Emacs when either | 570 | /* Let's send the data to Emacs when either |
| 572 | - the data ends in "\n", or | 571 | - the data ends in "\n", or |
| @@ -1281,7 +1280,7 @@ main (argc, argv) | |||
| 1281 | exit (EXIT_FAILURE); | 1280 | exit (EXIT_FAILURE); |
| 1282 | } | 1281 | } |
| 1283 | 1282 | ||
| 1284 | if ((s = set_socket ()) == INVALID_SOCKET) | 1283 | if ((emacs_socket = set_socket ()) == INVALID_SOCKET) |
| 1285 | fail (); | 1284 | fail (); |
| 1286 | 1285 | ||
| 1287 | 1286 | ||
| @@ -1453,7 +1452,7 @@ main (argc, argv) | |||
| 1453 | fsync (1); | 1452 | fsync (1); |
| 1454 | 1453 | ||
| 1455 | /* Now, wait for an answer and print any messages. */ | 1454 | /* Now, wait for an answer and print any messages. */ |
| 1456 | while ((rl = recv (s, string, BUFSIZ, 0)) > 0) | 1455 | while ((rl = recv (emacs_socket, string, BUFSIZ, 0)) > 0) |
| 1457 | { | 1456 | { |
| 1458 | char *p; | 1457 | char *p; |
| 1459 | string[rl] = '\0'; | 1458 | string[rl] = '\0'; |
| @@ -1523,7 +1522,7 @@ main (argc, argv) | |||
| 1523 | fflush (stdout); | 1522 | fflush (stdout); |
| 1524 | fsync (1); | 1523 | fsync (1); |
| 1525 | 1524 | ||
| 1526 | CLOSE_SOCKET (s); | 1525 | CLOSE_SOCKET (emacs_socket); |
| 1527 | return EXIT_SUCCESS; | 1526 | return EXIT_SUCCESS; |
| 1528 | } | 1527 | } |
| 1529 | 1528 | ||