Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!PIT-MANAGER.MIT.EDU!jik From: jik@PIT-MANAGER.MIT.EDU (Jonathan I. Kamens) Newsgroups: gnu.emacs.bug Subject: emacsclient.c Message-ID: <9001250205.AA03803@W20-575-37.MIT.EDU> Date: 25 Jan 90 02:05:09 GMT References: <9001242312.AA08614@kosciusko.ESD.3Com.COM> Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 211 Date: Wed, 24 Jan 90 15:12:49 PST From: Mark D. Baushke The patch you posted is NOT against the 18.55 version of emacsclient.c . Your patch failed with two hunks rejected. I suggest you obtain a 'virgin' copy of dist-18.55/etc/emacsclient.c and create the patch again. You're right. Sorry about that, I assumed that the sources we were using At Project Athena were the most up-to-date. Silly assumption. Below is a patch to the version of emacsclient.c in the 18.55 distribution. Jonathan Kamens USnail: MIT Project Athena 11 Ashford Terrace jik@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8495 Home: 617-782-0710 ************************* *** /tmp/,RCSt1007578 Wed Jan 24 21:00:12 1990 --- emacsclient.c Wed Jan 24 20:54:24 1990 *************** *** 31,40 **** #if !defined(BSD) && !defined(HAVE_SYSVIPC) #include ! main () { ! fprintf (stderr, "Sorry, the Emacs server is supported only on Berkeley Unix\n"); ! fprintf (stderr, "or System V systems with IPC\n"); exit (1); } --- 31,44 ---- #if !defined(BSD) && !defined(HAVE_SYSVIPC) #include ! /* ARGSUSED */ ! main (argc, argv) ! int argc; ! char *argv[]; { ! fprintf (stderr, "%s: Sorry, the Emacs server is supported only\n", ! argv[0]); ! fprintf (stderr, "on Berkeley Unix or System V systems with IPC\n"); exit (1); } *************** *** 57,68 **** struct sockaddr_un server; char *homedir, *cwd, *str; char string[BUFSIZ]; char *getenv (), *getwd (); if (argc < 2) { ! printf ("Usage: %s [filename]\n", argv[0]); exit (1); } --- 61,73 ---- struct sockaddr_un server; char *homedir, *cwd, *str; char string[BUFSIZ]; + char error_buf[BUFSIZ]; char *getenv (), *getwd (); if (argc < 2) { ! fprintf (stderr, "Usage: %s [filename]\n", argv[0]); exit (1); } *************** *** 72,96 **** if ((s = socket (AF_UNIX, SOCK_STREAM, 0)) < 0) { ! perror ("socket"); exit (1); } server.sun_family = AF_UNIX; if ((homedir = getenv ("HOME")) == NULL) { ! fprintf (stderr, "No home directory\n"); ! exit (1); } strcpy (server.sun_path, homedir); strcat (server.sun_path, "/.emacs_server"); if (connect (s, &server, strlen (server.sun_path) + 2) < 0) { ! perror ("connect"); exit (1); } if ((out = fdopen (s, "r+")) == NULL) { ! perror ("fdopen"); exit (1); } --- 77,104 ---- if ((s = socket (AF_UNIX, SOCK_STREAM, 0)) < 0) { ! (void) sprintf(error_buf, "%s: socket", argv[0]); ! perror (error_buf); exit (1); } server.sun_family = AF_UNIX; if ((homedir = getenv ("HOME")) == NULL) { ! fprintf(stderr, "%s: No home directory\n", argv[0]); ! exit(1); } strcpy (server.sun_path, homedir); strcat (server.sun_path, "/.emacs_server"); if (connect (s, &server, strlen (server.sun_path) + 2) < 0) { ! (void) sprintf(error_buf, "%s: connect", argv[0]); ! perror (error_buf); exit (1); } if ((out = fdopen (s, "r+")) == NULL) { ! (void) sprintf(error_buf, "%s: fdopen", argv[0]); ! perror (error_buf); exit (1); } *************** *** 146,154 **** struct msqid_ds * msg_st; char *homedir, *getenv (), buf[BUFSIZ]; char *getwd (), *getcwd (), gwdirb[BUFSIZ], *cwd; if (argc < 2) { ! printf ("Usage: %s [filename]\n", argv[0]); exit (1); } --- 154,164 ---- struct msqid_ds * msg_st; char *homedir, *getenv (), buf[BUFSIZ]; char *getwd (), *getcwd (), gwdirb[BUFSIZ], *cwd; + char error_buf[BUFSIZ]; + if (argc < 2) { ! fprintf (stderr, "Usage: %s [filename]\n", argv[0]); exit (1); } *************** *** 157,163 **** */ if ((homedir = getenv ("HOME")) == NULL) { ! fprintf (stderr,"No home directory\n"); exit (1); } strcpy (buf, homedir); --- 167,173 ---- */ if ((homedir = getenv ("HOME")) == NULL) { ! fprintf (stderr,"%s: No home directory\n", argv[0]); exit (1); } strcpy (buf, homedir); *************** *** 167,173 **** s = msgget (key, 0600); if (s == -1) { ! perror ("msgget"); exit (1); } --- 177,184 ---- s = msgget (key, 0600); if (s == -1) { ! (void) sprintf(error_buf, "%s: msgget", argv[0]); ! perror (error_buf); exit (1); } *************** *** 204,210 **** msgp->mtype = 1; if (msgsnd (s, msgp, strlen (msgp->mtext)+1, 1, 0) < 0) { ! perror ("msgsnd"); exit (1); } /* --- 215,222 ---- msgp->mtype = 1; if (msgsnd (s, msgp, strlen (msgp->mtext)+1, 1, 0) < 0) { ! (void) sprintf(error_buf, "%s: msgsnd", argv[0]); ! perror (error_buf); exit (1); } /*