Mercurial > hg > xemacs-beta
comparison lib-src/gnuclient.c @ 458:c33ae14dd6d0 r21-2-44
Import from CVS: tag r21-2-44
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:42:25 +0200 |
parents | e7ef97881643 |
children | 0784d089fdc9 |
comparison
equal
deleted
inserted
replaced
457:4b9290a33024 | 458:c33ae14dd6d0 |
---|---|
101 /* We want emacs to realize that we are resuming */ | 101 /* We want emacs to realize that we are resuming */ |
102 #ifdef SIGCONT | 102 #ifdef SIGCONT |
103 signal(SIGCONT, tell_emacs_to_resume); | 103 signal(SIGCONT, tell_emacs_to_resume); |
104 #endif | 104 #endif |
105 | 105 |
106 connect_type = make_connection (NULL, (u_short) 0, &s); | 106 connect_type = make_connection (NULL, 0, &s); |
107 | 107 |
108 sprintf(buffer,"(gnuserv-eval '(resume-pid-console %d))", (int)getpid()); | 108 sprintf(buffer,"(gnuserv-eval '(resume-pid-console %d))", (int)getpid()); |
109 send_string(s, buffer); | 109 send_string(s, buffer); |
110 | 110 |
111 #ifdef SYSV_IPC | 111 #ifdef SYSV_IPC |
154 static char * | 154 static char * |
155 get_current_working_directory (void) | 155 get_current_working_directory (void) |
156 { | 156 { |
157 if (cp == NULL) | 157 if (cp == NULL) |
158 { /* haven't calculated it yet */ | 158 { /* haven't calculated it yet */ |
159 #ifdef BSD | 159 #ifdef HAVE_GETCWD |
160 if (getcwd (cwd,MAXPATHLEN) == NULL) | |
161 #else | |
160 if (getwd (cwd) == 0) | 162 if (getwd (cwd) == 0) |
161 #else /* !BSD */ | 163 #endif /* HAVE_GETCWD */ |
162 if (getcwd (cwd,MAXPATHLEN) == NULL) | |
163 #endif /* !BSD */ | |
164 { | 164 { |
165 perror (progname); | 165 perror (progname); |
166 fprintf (stderr, "%s: unable to get current working directory\n", | 166 fprintf (stderr, "%s: unable to get current working directory\n", |
167 progname); | 167 progname); |
168 exit (1); | 168 exit (1); |
335 char thishost[HOSTNAMSZ]; /* this hostname */ | 335 char thishost[HOSTNAMSZ]; /* this hostname */ |
336 char remotepath[MAXPATHLEN+1]; /* remote pathname */ | 336 char remotepath[MAXPATHLEN+1]; /* remote pathname */ |
337 char *path; | 337 char *path; |
338 int rflg = 0; /* pathname given on cmdline */ | 338 int rflg = 0; /* pathname given on cmdline */ |
339 char *portarg; | 339 char *portarg; |
340 u_short port = 0; /* port to server */ | 340 unsigned short port = 0; /* port to server */ |
341 #endif /* INTERNET_DOMAIN_SOCKETS */ | 341 #endif /* INTERNET_DOMAIN_SOCKETS */ |
342 #ifdef SYSV_IPC | 342 #ifdef SYSV_IPC |
343 struct msgbuf *msgp; /* message */ | 343 struct msgbuf *msgp; /* message */ |
344 #endif /* SYSV_IPC */ | 344 #endif /* SYSV_IPC */ |
345 char *tty = NULL; | 345 char *tty = NULL; |
486 if (eval_function || eval_form || load_library) | 486 if (eval_function || eval_form || load_library) |
487 { | 487 { |
488 #if defined(INTERNET_DOMAIN_SOCKETS) | 488 #if defined(INTERNET_DOMAIN_SOCKETS) |
489 connect_type = make_connection (hostarg, port, &s); | 489 connect_type = make_connection (hostarg, port, &s); |
490 #else | 490 #else |
491 connect_type = make_connection (NULL, (u_short) 0, &s); | 491 connect_type = make_connection (NULL, 0, &s); |
492 #endif | 492 #endif |
493 sprintf (command, "(gnuserv-eval%s '(progn ", quick ? "-quickly" : ""); | 493 sprintf (command, "(gnuserv-eval%s '(progn ", quick ? "-quickly" : ""); |
494 send_string (s, command); | 494 send_string (s, command); |
495 if (load_library) | 495 if (load_library) |
496 { | 496 { |
524 int nb; | 524 int nb; |
525 | 525 |
526 #if defined(INTERNET_DOMAIN_SOCKETS) | 526 #if defined(INTERNET_DOMAIN_SOCKETS) |
527 connect_type = make_connection (hostarg, port, &s); | 527 connect_type = make_connection (hostarg, port, &s); |
528 #else | 528 #else |
529 connect_type = make_connection (NULL, (u_short) 0, &s); | 529 connect_type = make_connection (NULL, 0, &s); |
530 #endif | 530 #endif |
531 sprintf (command, "(gnuserv-eval%s '(progn ", quick ? "-quickly" : ""); | 531 sprintf (command, "(gnuserv-eval%s '(progn ", quick ? "-quickly" : ""); |
532 send_string (s, command); | 532 send_string (s, command); |
533 | 533 |
534 while ((nb = read(fileno(stdin), buffer, GSERV_BUFSZ-1)) > 0) | 534 while ((nb = read(fileno(stdin), buffer, GSERV_BUFSZ-1)) > 0) |
558 exit (1); | 558 exit (1); |
559 } | 559 } |
560 #if defined(INTERNET_DOMAIN_SOCKETS) | 560 #if defined(INTERNET_DOMAIN_SOCKETS) |
561 connect_type = make_connection (hostarg, port, &s); | 561 connect_type = make_connection (hostarg, port, &s); |
562 #else | 562 #else |
563 connect_type = make_connection (NULL, (u_short) 0, &s); | 563 connect_type = make_connection (NULL, 0, &s); |
564 #endif | 564 #endif |
565 send_string (s, "(gnuserv-eval '(emacs-pid))"); | 565 send_string (s, "(gnuserv-eval '(emacs-pid))"); |
566 send_string (s, EOT_STR); | 566 send_string (s, EOT_STR); |
567 | 567 |
568 if (read_line (s, buffer) == 0) | 568 if (read_line (s, buffer) == 0) |
583 } /* suppress_windows_system */ | 583 } /* suppress_windows_system */ |
584 | 584 |
585 #if defined(INTERNET_DOMAIN_SOCKETS) | 585 #if defined(INTERNET_DOMAIN_SOCKETS) |
586 connect_type = make_connection (hostarg, port, &s); | 586 connect_type = make_connection (hostarg, port, &s); |
587 #else | 587 #else |
588 connect_type = make_connection (NULL, (u_short) 0, &s); | 588 connect_type = make_connection (NULL, 0, &s); |
589 #endif | 589 #endif |
590 | 590 |
591 #ifdef INTERNET_DOMAIN_SOCKETS | 591 #ifdef INTERNET_DOMAIN_SOCKETS |
592 if (connect_type == (int) CONN_INTERNET) | 592 if (connect_type == (int) CONN_INTERNET) |
593 { | 593 { |