From c83a1326cfc4f01b27049b60c63521716189a912 Mon Sep 17 00:00:00 2001 From: gumartinm Date: Tue, 18 Dec 2012 06:30:04 +0100 Subject: [PATCH] Right type for storing return code from fork --- Daemon/javafork.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Daemon/javafork.c b/Daemon/javafork.c index fff50ec..86a1062 100644 --- a/Daemon/javafork.c +++ b/Daemon/javafork.c @@ -545,7 +545,7 @@ end: int fork_system(int socket, unsigned char *command, int *returnstatus) { - int pid; /*Child or parent PID.*/ + pid_t pid; /*Child or parent PID.*/ int out[2], err[2]; /*Store pipes file descriptors. Write ends attached to the stdout*/ /*and stderr streams.*/ u_char buf[2000]; /*Read data buffer. allignment(int) * 500.*/ @@ -599,7 +599,7 @@ int fork_system(int socket, unsigned char *command, int *returnstatus) exit(-1); } - /*Attach pipes to the stderr and stdout streams*/ + /*Attach stderr and stdout streams to my pipes (their write end)*/ if ((TEMP_FAILURE_RETRY(dup2(out[1], 1)) < 0) || (TEMP_FAILURE_RETRY(dup2(err[1], 2)) < 0)) { syslog (LOG_ERR, "child dup2 failed: %m"); /*Going to zombie state, hopefully waitpid will catch it*/ -- 2.1.4