+2007-05-16 Jason Rumney <jasonr@gnu.org>
+
+ * emacsclient.c: (emacs_socket): Rename from s.
+ Move definition below includes it depends on.
+
2007-05-16 Dan Nicolaescu <dann@ics.uci.edu>
* emacsclient.c (s): Restore.
#define VERSION "unspecified"
#endif
\f
-#define SEND_STRING(data) (send_to_emacs (s, (data)))
-#define SEND_QUOTED(data) (quote_argument (s, (data)))
+#define SEND_STRING(data) (send_to_emacs (emacs_socket, (data)))
+#define SEND_QUOTED(data) (quote_argument (emacs_socket, (data)))
#ifndef EXIT_SUCCESS
#define EXIT_SUCCESS 0
/* PID of the Emacs server process. */
int emacs_pid = 0;
-/* Socket used to communicate with the Emacs server process. */
-HSOCKET s;
-
void print_help_and_exit () NO_RETURN;
struct option longopts[] =
/* Buffer to accumulate data to send in TCP connections. */
char send_buffer[SEND_BUFFER_SIZE + 1];
int sblen = 0; /* Fill pointer for the send buffer. */
+/* Socket used to communicate with the Emacs server process. */
+HSOCKET emacs_socket = 0;
/* Let's send the data to Emacs when either
- the data ends in "\n", or
exit (EXIT_FAILURE);
}
- if ((s = set_socket ()) == INVALID_SOCKET)
+ if ((emacs_socket = set_socket ()) == INVALID_SOCKET)
fail ();
fsync (1);
/* Now, wait for an answer and print any messages. */
- while ((rl = recv (s, string, BUFSIZ, 0)) > 0)
+ while ((rl = recv (emacs_socket, string, BUFSIZ, 0)) > 0)
{
char *p;
string[rl] = '\0';
fflush (stdout);
fsync (1);
- CLOSE_SOCKET (s);
+ CLOSE_SOCKET (emacs_socket);
return EXIT_SUCCESS;
}