X-Git-Url: http://git.tuebingen.mpg.de/?p=dss.git;a=blobdiff_plain;f=exec.c;h=a5d0cd08f34fee97921a139bef766d70191aaa69;hp=4e7acd51b1a5ade3036ffd35222615dad26c5298;hb=2be48c0ac582aca639003528eeae2250af42471b;hpb=301b9cccfc5de2489b70a46850933ff688ed9732 diff --git a/exec.c b/exec.c index 4e7acd5..a5d0cd0 100644 --- a/exec.c +++ b/exec.c @@ -1,3 +1,9 @@ +/* + * Copyright (C) 2003-2009 Andre Noll + * + * Licensed under the GPL v2. For licencing details see COPYING. + */ + /** \file exec.c Helper functions for spawning new processes. */ #include @@ -11,6 +17,7 @@ #include "gcc-compat.h" +#include "log.h" #include "error.h" #include "string.h" @@ -41,7 +48,7 @@ int dss_exec(pid_t *pid, const char *file, char *const *const args, int *fds) goto err_out; if (!fds[0] || !fds[1] || !fds[2]) { ret = -E_NULL_OPEN; - null = open("/dev/null", O_RDONLY); + null = open("/dev/null", O_RDWR); if (null < 0) goto err_out; } @@ -96,7 +103,7 @@ int dss_exec(pid_t *pid, const char *file, char *const *const args, int *fds) close(null); return 1; err_out: - make_err_msg("failed to exec %s", file); + DSS_ERROR_LOG("failed to exec %s\n", file); if (err[0] >= 0) close(err[0]); if (err[1] >= 0)