diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-03-12 15:11:33 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-03-12 15:11:33 +0000 |
commit | b3a9e818686c83caeb5b4fd9763437eac0d32654 (patch) | |
tree | e30ba2c619db064d488aed66a29a89ff6a96efb3 /fish/rc.c | |
parent | 1f603bfd6d7cd17e88f737a496b7e5ee053750c2 (diff) | |
download | libguestfs-b3a9e818686c83caeb5b4fd9763437eac0d32654.tar.gz libguestfs-b3a9e818686c83caeb5b4fd9763437eac0d32654.tar.xz libguestfs-b3a9e818686c83caeb5b4fd9763437eac0d32654.zip |
fish: remote: Move close_stdout just before accept() call.
This is just code motion.
Diffstat (limited to 'fish/rc.c')
-rw-r--r-- | fish/rc.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -237,13 +237,14 @@ rc_listen (void) exit (EXIT_FAILURE); } - /* Now close stdout and substitute /dev/null. This is necessary - * so that eval `guestfish --listen` doesn't block forever. - */ - close_stdout(); - /* Read commands and execute them. */ while (!quit) { + /* Before waiting, close stdout and substitute /dev/null. This is + * necessary so that eval `guestfish --listen` doesn't block + * forever. + */ + close_stdout (); + s = accept (sock, NULL, NULL); if (s == -1) perror ("accept"); @@ -305,7 +306,6 @@ rc_listen (void) error: xdr_destroy (&xdr); /* NB. This doesn't close 'fp'. */ fclose (fp); /* Closes the underlying socket 's'. */ - close_stdout(); /* Re-close stdout */ } } |