diff options
Diffstat (limited to 'xinit.c')
-rw-r--r-- | xinit.c | 31 |
1 files changed, 16 insertions, 15 deletions
@@ -101,15 +101,15 @@ static char *displayNum = NULL; static char *program = NULL; static Display *xd = NULL; /* server connection */ int status; -int serverpid = -1; -int clientpid = -1; +pid_t serverpid = -1; +pid_t clientpid = -1; volatile int gotSignal = 0; static void Execute(char **vec); static Bool waitforserver(void); static Bool processTimeout(int timeout, const char *string); -static int startServer(char *server[]); -static int startClient(char *client[]); +static pid_t startServer(char *server[]); +static pid_t startClient(char *client[]); static int ignorexio(Display *dpy); static void shutdown(void); static void set_environment(void); @@ -149,7 +149,7 @@ main(int argc, char *argv[]) register char **sptr = server; register char **cptr = client; register char **ptr; - int pid; + pid_t pid; int client_given = 0, server_given = 0; int client_args_given = 0, server_args_given = 0; int start_of_client_args, start_of_server_args; @@ -366,7 +366,8 @@ waitforserver(void) static Bool processTimeout(int timeout, const char *string) { - int i = 0, pidfound = -1; + int i = 0; + pid_t pidfound = -1; static const char *laststring; for (;;) { @@ -388,8 +389,8 @@ processTimeout(int timeout, const char *string) return (serverpid != pidfound); } -static int -startServer(char *server[]) +static pid_t +startServer(char *server_argv[]) { sigset_t mask, old; const char * const *cpp; @@ -421,12 +422,12 @@ startServer(char *server[]) * if client is xterm -L */ setpgid(0,getpid()); - Execute(server); + Execute(server_argv); - Error("unable to run server \"%s\"", server[0]); + Error("unable to run server \"%s\"", server_argv[0]); fprintf(stderr, "Use the -- option, or make sure that %s is in your path and\n", bindir); - fprintf(stderr, "that \"%s\" is a program or a link to the right type of server\n", server[0]); + fprintf(stderr, "that \"%s\" is a program or a link to the right type of server\n", server_argv[0]); fprintf(stderr, "for your display. Possible server names include:\n\n"); for (cpp = server_names; *cpp; cpp++) fprintf(stderr, " %s\n", *cpp); @@ -554,8 +555,8 @@ setWindowPath(void) free(newwindowpath); } -static int -startClient(char *client[]) +static pid_t +startClient(char *client_argv[]) { clientpid = fork(); if (clientpid == 0) { @@ -567,8 +568,8 @@ startClient(char *client[]) _exit(EXIT_FAILURE); } setpgid(0, getpid()); - Execute(client); - Error("Unable to run program \"%s\"", client[0]); + Execute(client_argv); + Error("Unable to run program \"%s\"", client_argv[0]); fprintf(stderr, "Specify a program on the command line or make sure that %s\n", bindir); fprintf(stderr, "is in your path.\n\n"); |