From 40be0654bde9821298f70c17d53529d82918a015 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 11 Jun 2010 21:29:31 +0000 Subject: [PATCH] error checking --- src/util/os_priority.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/util/os_priority.c b/src/util/os_priority.c index 77b262703..7e6750e8b 100644 --- a/src/util/os_priority.c +++ b/src/util/os_priority.c @@ -233,19 +233,20 @@ GNUNET_OS_start_process (struct GNUNET_DISK_PipeHandle *pipe_stdin, if (pipe_stdout != NULL) { - dup2(fd_stdout_write, 1); - close (fd_stdout_write); - close (fd_stdout_read); + GNUNET_break (0 == close (fd_stdout_read)); + if (-1 == dup2(fd_stdout_write, 1)) + GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "dup2"); + GNUNET_break (0 == close (fd_stdout_write)); } if (pipe_stdin != NULL) { - dup2(fd_stdin_read, 0); - close (fd_stdin_read); - close (fd_stdin_write); + GNUNET_break (0 == close (fd_stdin_write)); + if (-1 == dup2(fd_stdin_read, 0)) + GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "dup2"); + GNUNET_break (0 == close (fd_stdin_read)); } - execvp (filename, argv); GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "execvp", filename); _exit (1); -- 2.25.1