X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib-src%2Fgnuclient.c;h=6d96b475c5b7a298969fee2981e35dc773fc4d02;hb=a1655b870904de973c366d85ebdc8adde4ef5e1e;hp=e8797c19cc059125bd4b2bfcb5bb3b0fb7086a18;hpb=72a705551741d6f85a40eea486c222bac482d8dc;p=chise%2Fxemacs-chise.git diff --git a/lib-src/gnuclient.c b/lib-src/gnuclient.c index e8797c1..6d96b47 100644 --- a/lib-src/gnuclient.c +++ b/lib-src/gnuclient.c @@ -48,6 +48,8 @@ static char rcsid [] = "!Header: gnuclient.c,v 2.2 95/12/12 01:39:21 wing nene ! #include #include #include +#define DONT_ENCAPSULATE +#include #ifdef HAVE_STRING_H #include @@ -89,7 +91,9 @@ tell_emacs_to_resume (int sig) /* Why is SYSV so retarded? */ /* We want emacs to realize that we are resuming */ +#ifdef SIGCONT signal(SIGCONT, tell_emacs_to_resume); +#endif connect_type = make_connection (NULL, (u_short) 0, &s); @@ -117,7 +121,7 @@ pass_signal_to_emacs (int sig) } void -initialize_signals () +initialize_signals (void) { /* Set up signal handler to pass relevant signals to emacs process. We used to send SIGSEGV, SIGBUS, SIGPIPE, SIGILL and others to @@ -129,8 +133,10 @@ initialize_signals () signal (SIGWINCH, pass_signal_to_emacs); #endif +#ifdef SIGCONT /* We want emacs to realize that we are resuming */ signal (SIGCONT, tell_emacs_to_resume); +#endif } @@ -217,19 +223,21 @@ filename_expand (char *fullpath, char *filename) ; /* yep */ else strcat (fullpath, "/"); /* nope, append trailing slash */ + /* Don't forget to add the filename! */ + strcat (fullpath,filename); } } /* filename_expand */ /* Encase the string in quotes, escape all the backslashes and quotes in string. */ static char * -clean_string (CONST char *s) +clean_string (const char *s) { int i = 0; char *p, *res; { - CONST char *const_p; + const char *const_p; for (const_p = s; *const_p; const_p++, i++) { if (*const_p == '\\' || *const_p == '\"') @@ -283,14 +291,14 @@ clean_string (CONST char *s) over = 1; \ } while (0) -/* A strdup immitation. */ +/* A strdup imitation. */ static char * -my_strdup (CONST char *s) +my_strdup (const char *s) { - char *new = malloc (strlen (s) + 1); - if (new) - strcpy (new, s); - return new; + char *new_s = (char *) malloc (strlen (s) + 1); + if (new_s) + strcpy (new_s, s); + return new_s; } int @@ -551,7 +559,7 @@ main (int argc, char *argv[]) if (read_line (s, buffer) == 0) { - fprintf (stderr, "%s: Could not establish Emacs procces id\n", + fprintf (stderr, "%s: Could not establish Emacs process id\n", progname); exit (1); } @@ -652,7 +660,7 @@ main (int argc, char *argv[]) } filename_expand (fullpath, argv[i]); #ifdef INTERNET_DOMAIN_SOCKETS - path = malloc (strlen (remotepath) + strlen (fullpath) + 1); + path = (char *) malloc (strlen (remotepath) + strlen (fullpath) + 1); sprintf (path, "%s%s", remotepath, fullpath); #else path = my_strdup (fullpath);