summaryrefslogtreecommitdiff
path: root/src/ostree/ot-builtin-trivial-httpd.c
diff options
context:
space:
mode:
authorVivek Dasmohapatra <vivek@collabora.co.uk>2013-08-22 19:43:44 +0100
committerColin Walters <walters@verbum.org>2013-08-23 12:28:37 -0400
commit3dc6cedba55f3250175c56b913680d9bd7c9b1d4 (patch)
tree36b5f8edfea923196d1a5887ad3f5bc9d79e5648 /src/ostree/ot-builtin-trivial-httpd.c
parent4f127b2d7db3d28ac5d7a29c8e087be05b2df006 (diff)
downloadostree-3dc6cedba55f3250175c56b913680d9bd7c9b1d4.tar.gz
trivial-httpd: Close stdout & stdin so $() can capture output when daemonized
Will be used by tests.
Diffstat (limited to 'src/ostree/ot-builtin-trivial-httpd.c')
-rw-r--r--src/ostree/ot-builtin-trivial-httpd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ostree/ot-builtin-trivial-httpd.c b/src/ostree/ot-builtin-trivial-httpd.c
index 178f20c5..3c8fff9b 100644
--- a/src/ostree/ot-builtin-trivial-httpd.c
+++ b/src/ostree/ot-builtin-trivial-httpd.c
@@ -334,6 +334,9 @@ ostree_builtin_trivial_httpd (int argc, char **argv, GFile *repo_path, GCancella
_exit (0);
}
/* Child, continue */
+ /* Daemonising: close stdout/stderr so $() et al work on us */
+ fclose (stdout);
+ fclose (stdin);
}
app->running = TRUE;