X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Fguestfsd.c;h=51bb0b7341fa680b3200c53a27d2c3044b52dfef;hb=527079aa0db9b608ee4c25e7b3eccc4058685608;hp=116a6b924f91db1c796c6e8e1f42480a659b85b4;hpb=29453a58d818df24c238d0a08a68886ebe4029dd;p=libguestfs.git diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c index 116a6b9..51bb0b7 100644 --- a/daemon/guestfsd.c +++ b/daemon/guestfsd.c @@ -111,6 +111,9 @@ int autosync_umount = 1; /* Not used explicitly, but required by the gnulib 'error' module. */ const char *program_name = "guestfsd"; +/* Name of the virtio-serial channel. */ +#define VIRTIO_SERIAL_CHANNEL "/dev/virtio-ports/org.libguestfs.channel.0" + static void usage (void) { @@ -237,8 +240,7 @@ main (int argc, char *argv[]) #endif /* Connect to virtio-serial channel. */ - int sock = open ("/dev/virtio-ports/org.libguestfs.channel.0", - O_RDWR | O_CLOEXEC); + int sock = open (VIRTIO_SERIAL_CHANNEL, O_RDWR | O_CLOEXEC); if (sock == -1) { fprintf (stderr, "\n" @@ -253,7 +255,7 @@ main (int argc, char *argv[]) "output to the libguestfs developers, either in a bug report\n" "or on the libguestfs redhat com mailing list.\n" "\n"); - perror ("/dev/virtio-ports/org.libguestfs.channel.0"); + perror (VIRTIO_SERIAL_CHANNEL); exit (EXIT_FAILURE); } @@ -689,7 +691,7 @@ commandrvf (char **stdoutput, char **stderror, int flags, close (stdin_fd[1]); } else { /* Set stdin to /dev/null (ignore failure) */ - open ("/dev/null", O_RDONLY); + ignore_value (open ("/dev/null", O_RDONLY)); } close (so_fd[0]); close (se_fd[0]);