[ostree] trivial-httpd: Close stdout & stdin so $() can capture output when daemonized
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree] trivial-httpd: Close stdout & stdin so $() can capture output when daemonized
- Date: Fri, 23 Aug 2013 16:43:00 +0000 (UTC)
commit 3dc6cedba55f3250175c56b913680d9bd7c9b1d4
Author: Vivek Dasmohapatra <vivek collabora co uk>
Date: Thu Aug 22 19:43:44 2013 +0100
trivial-httpd: Close stdout & stdin so $() can capture output when daemonized
Will be used by tests.
src/ostree/ot-builtin-trivial-httpd.c | 3 +++
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 178f20c..3c8fff9 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]