summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2010-05-07 22:50:50 +0100
committerRichard Jones <rjones@redhat.com>2010-05-07 22:51:20 +0100
commitf606a79ed7a20ee59bc0755b1030c6d29e503724 (patch)
treef3f1041b10a06d08e33aa3e9122f623c5ecaccce
parentb52ef0b021fc443d88d4d9c43f57468712e40965 (diff)
downloadlibguestfs-f606a79ed7a20ee59bc0755b1030c6d29e503724.tar.gz
libguestfs-f606a79ed7a20ee59bc0755b1030c6d29e503724.tar.xz
libguestfs-f606a79ed7a20ee59bc0755b1030c6d29e503724.zip
daemon: Use 'error' instead of 'perror' before calling 'abort'.
-rw-r--r--daemon/guestfsd.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c
index ef28d9b6..c0d524aa 100644
--- a/daemon/guestfsd.c
+++ b/daemon/guestfsd.c
@@ -41,6 +41,7 @@
#include <sys/wait.h>
#include <arpa/inet.h>
#include <netinet/in.h>
+#include <errno.h>
#ifdef HAVE_PRINTF_H
# include <printf.h>
@@ -758,20 +759,20 @@ commandrvf (char **stdoutput, char **stderror, int flags,
*/
if (pipe (so_fd) == -1 || pipe (se_fd) == -1) {
- perror ("pipe");
+ error (0, errno, "pipe");
abort ();
}
if (flag_copy_stdin) {
if (pipe (stdin_fd) == -1) {
- perror ("pipe");
+ error (0, errno, "pipe");
abort ();
}
}
pid = fork ();
if (pid == -1) {
- perror ("fork");
+ error (0, errno, "fork");
abort ();
}
@@ -805,7 +806,7 @@ commandrvf (char **stdoutput, char **stderror, int flags,
stdin_pid = fork ();
if (stdin_pid == -1) {
- perror ("fork");
+ error (0, errno, "fork");
abort ();
}