Commit 4e7ef1d6 authored by Andreas Schwab's avatar Andreas Schwab
Browse files

Include <unistd.h> if available.

(main, handle_signals, perror_1, fatal_error): Explicitly declare
return types.  Add forward declarations.
parent 7f3bff3e
...@@ -37,6 +37,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -37,6 +37,7 @@ Boston, MA 02111-1307, USA. */
#if !defined (HAVE_SOCKETS) && !defined (HAVE_SYSVIPC) #if !defined (HAVE_SOCKETS) && !defined (HAVE_SYSVIPC)
#include <stdio.h> #include <stdio.h>
int
main () main ()
{ {
fprintf (stderr, "Sorry, the Emacs server is supported only on systems\n"); fprintf (stderr, "Sorry, the Emacs server is supported only on systems\n");
...@@ -46,6 +47,9 @@ main () ...@@ -46,6 +47,9 @@ main ()
#else /* HAVE_SOCKETS or HAVE_SYSVIPC */ #else /* HAVE_SOCKETS or HAVE_SYSVIPC */
void perror_1 ();
void fatal_error ();
#if defined (HAVE_SOCKETS) && ! defined (NO_SOCKETS_IN_FILE_SYSTEM) #if defined (HAVE_SOCKETS) && ! defined (NO_SOCKETS_IN_FILE_SYSTEM)
/* BSD code is very different from SYSV IPC code */ /* BSD code is very different from SYSV IPC code */
...@@ -57,6 +61,10 @@ main () ...@@ -57,6 +61,10 @@ main ()
#include <errno.h> #include <errno.h>
#include <sys/stat.h> #include <sys/stat.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
extern int errno; extern int errno;
/* Copied from src/process.c */ /* Copied from src/process.c */
...@@ -104,6 +112,7 @@ delete_socket (sig) ...@@ -104,6 +112,7 @@ delete_socket (sig)
/* Set up to handle all the signals. */ /* Set up to handle all the signals. */
void
handle_signals () handle_signals ()
{ {
signal (SIGHUP, delete_socket); signal (SIGHUP, delete_socket);
...@@ -414,6 +423,7 @@ msgcatch () ...@@ -414,6 +423,7 @@ msgcatch ()
Its stderr always exists--rms. */ Its stderr always exists--rms. */
#include <stdio.h> #include <stdio.h>
int
main () main ()
{ {
int s, infd, fromlen, ioproc; int s, infd, fromlen, ioproc;
...@@ -547,6 +557,7 @@ main () ...@@ -547,6 +557,7 @@ main ()
/* This is like perror but puts `Error: ' at the beginning. */ /* This is like perror but puts `Error: ' at the beginning. */
void
perror_1 (string) perror_1 (string)
char *string; char *string;
{ {
...@@ -559,6 +570,7 @@ perror_1 (string) ...@@ -559,6 +570,7 @@ perror_1 (string)
perror (copy); perror (copy);
} }
void
fatal_error (string) fatal_error (string)
char *string; char *string;
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment