comparison lib-src/emacsclient.c @ 12:bcdc7deadc19 r19-15b7

Import from CVS: tag r19-15b7
author cvs
date Mon, 13 Aug 2007 08:48:16 +0200
parents 376386a54a3c
children 131b0175ea99
comparison
equal deleted inserted replaced
11:91ffe8bd52e4 12:bcdc7deadc19
36 #endif 36 #endif
37 37
38 #if !defined(HAVE_SOCKETS) && !defined(HAVE_SYSVIPC) 38 #if !defined(HAVE_SOCKETS) && !defined(HAVE_SYSVIPC)
39 #include <stdio.h> 39 #include <stdio.h>
40 40
41 main (argc, argv) 41 int
42 int argc; 42 main (int argc, char *argv[])
43 char **argv;
44 { 43 {
45 fprintf (stderr, "%s: Sorry, the Emacs server is supported only\n", 44 fprintf (stderr, "%s: Sorry, the Emacs server is supported only\n",
46 argv[0]); 45 argv[0]);
47 fprintf (stderr, "on systems with Berkeley sockets or System V IPC.\n"); 46 fprintf (stderr, "on systems with Berkeley sockets or System V IPC.\n");
48 exit (1); 47 exit (1);
61 #include <errno.h> 60 #include <errno.h>
62 61
63 extern char *strerror (); 62 extern char *strerror ();
64 extern int errno; 63 extern int errno;
65 64
66 void 65 int
67 main (argc, argv) 66 main (int argc, char *argv[])
68 int argc;
69 char **argv;
70 { 67 {
71 char system_name[256]; 68 char system_name[256];
72 int s, i; 69 int s, i;
73 FILE *out; 70 FILE *out;
74 struct sockaddr_un server; 71 struct sockaddr_un server;
178 /* Now, wait for an answer and print any messages. */ 175 /* Now, wait for an answer and print any messages. */
179 176
180 while ((str = fgets (string, BUFSIZ, out))) 177 while ((str = fgets (string, BUFSIZ, out)))
181 printf ("%s", str); 178 printf ("%s", str);
182 179
183 exit (0); 180 return 0;
184 } 181 }
185 182
186 #else /* This is the SYSV IPC section */ 183 #else /* This is the SYSV IPC section */
187 184
188 #include <sys/types.h> 185 #include <sys/types.h>
193 char *getwd (); 190 char *getwd ();
194 #if !__STDC__ && !defined(STDC_HEADERS) 191 #if !__STDC__ && !defined(STDC_HEADERS)
195 char *getcwd (), *getenv (); 192 char *getcwd (), *getenv ();
196 #endif 193 #endif
197 194
198 void 195 int
199 main (argc, argv) 196 main (int argc, char *argv[])
200 int argc;
201 char **argv;
202 { 197 {
203 int s; 198 int s;
204 key_t key; 199 key_t key;
205 /* Size of text allocated in MSGP. */ 200 /* Size of text allocated in MSGP. */
206 int size_allocated = BUFSIZ; 201 int size_allocated = BUFSIZ;
333 328
334 #endif /* HAVE_SOCKETS or HAVE_SYSVIPC */ 329 #endif /* HAVE_SOCKETS or HAVE_SYSVIPC */
335 330
336 #ifndef HAVE_STRERROR 331 #ifndef HAVE_STRERROR
337 char * 332 char *
338 strerror (errnum) 333 strerror (int errnum)
339 int errnum;
340 { 334 {
341 extern char *sys_errlist[]; 335 extern char *sys_errlist[];
342 extern int sys_nerr; 336 extern int sys_nerr;
343 337
344 if (errnum >= 0 && errnum < sys_nerr) 338 if (errnum >= 0 && errnum < sys_nerr)