aboutsummaryrefslogtreecommitdiff
path: root/src/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/exec.c')
-rw-r--r--src/exec.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/exec.c b/src/exec.c
index 2c32956..4f4902d 100644
--- a/src/exec.c
+++ b/src/exec.c
@@ -50,7 +50,7 @@ start_prog (int argc, const char **argv, pid_t *ppid)
execvp (argv[0], (char**) argv);
logmsg (LOG_CRIT, "cannot run %s: %s", argv[0], strerror (errno));
exit (1);
-
+
case -1:
logmsg (LOG_CRIT, "cannot run `%s': fork failed: %s",
argv[0], strerror (errno));
@@ -74,7 +74,7 @@ log_output (int prio, const char *prog, FILE *fp)
{
size_t size = 0;
char *buf = NULL;
-
+
logmsg (prio, "%s output follows:", prog);
while (getline (&buf, &size, fp) > 0)
logmsg (prio, "%s", buf);
@@ -91,14 +91,14 @@ wydawca_exec (int argc, const char **argv, int *retcode)
int status;
int i;
enum exec_result res;
-
+
fp = start_prog (5, argv, &pid);
if (!fp)
{
logmsg (LOG_CRIT, "cannot start %s", argv[0]);
return exec_error;
}
-
+
for (i = 0; i < 5 && (npid = waitpid (pid, &status, WNOHANG)) == 0; i++)
sleep (1);
@@ -118,7 +118,7 @@ wydawca_exec (int argc, const char **argv, int *retcode)
kill (pid, SIGKILL);
fclose (fp);
return exec_error;
-
+
default:
break;
}
@@ -155,6 +155,6 @@ wydawca_exec (int argc, const char **argv, int *retcode)
argv[0]);
}
fclose (fp);
-
+
return res;
}

Return to:

Send suggestions and report system problems to the System administrator.