X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Flaunch.c;h=f8ab02926675c1c3226089d965f72a7d3a2cedde;hb=340a13f9915e5a06385a3ec2178e25539cfcd5bc;hp=0b15ce98d79fac55032a7e93788f62d0011e8c34;hpb=d889e457d1567880bd9439b26c847865b1a31f57;p=libguestfs.git diff --git a/src/launch.c b/src/launch.c index 0b15ce9..f8ab029 100644 --- a/src/launch.c +++ b/src/launch.c @@ -625,17 +625,27 @@ launch_appliance (guestfs_h *g) guestfs___print_timestamped_argv (g, (const char **)g->cmdline); if (!g->direct) { - /* Set up stdin, stdout. */ + /* Set up stdin, stdout, stderr. */ close (0); close (1); close (wfd[1]); close (rfd[0]); + /* Stdin. */ if (dup (wfd[0]) == -1) { dup_failed: perror ("dup failed"); _exit (EXIT_FAILURE); } + /* Stdout. */ + if (dup (rfd[1]) == -1) + goto dup_failed; + + /* Particularly since qemu 0.15, qemu spews all sorts of debug + * information on stderr. It is useful to both capture this and + * not confuse casual users, so send stderr to the pipe as well. + */ + close (2); if (dup (rfd[1]) == -1) goto dup_failed; @@ -678,7 +688,7 @@ launch_appliance (guestfs_h *g) pid_t parent_pid = getppid (); /* Writing to argv is hideously complicated and error prone. See: - * http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/misc/ps_status.c?rev=1.33.2.1;content-type=text%2Fplain + * http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/utils/misc/ps_status.c;hb=HEAD */ /* Loop around waiting for one or both of the other processes to