summaryrefslogtreecommitdiff
path: root/node/Utils.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2014-08-07 06:35:54 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2014-08-07 06:35:54 -0700
commit80fc5849233c63b60c91e3fc1bf106b810e45c36 (patch)
treea945eb80c628923fef41b1e06c37d07c4e990ff8 /node/Utils.hpp
parentb7389995f4003a2c1d1bb6b6ce9171be08565f6d (diff)
downloadinfinitytier-80fc5849233c63b60c91e3fc1bf106b810e45c36.tar.gz
infinitytier-80fc5849233c63b60c91e3fc1bf106b810e45c36.zip
Fix for GitHub issue #97
Diffstat (limited to 'node/Utils.hpp')
-rw-r--r--node/Utils.hpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/node/Utils.hpp b/node/Utils.hpp
index bafe0b39..91620d78 100644
--- a/node/Utils.hpp
+++ b/node/Utils.hpp
@@ -58,6 +58,21 @@ namespace ZeroTier {
class Utils
{
public:
+#ifdef __UNIX_LIKE__
+ /**
+ * Close STDOUT_FILENO and STDERR_FILENO and replace them with output to given path
+ *
+ * This can be called after fork() and prior to exec() to suppress output
+ * from a subprocess, such as auto-update.
+ *
+ * @param stdoutPath Path to file to use for stdout
+ * @param stderrPath Path to file to use for stderr, or NULL for same as stdout (default)
+ * @return True on success
+ */
+ static bool redirectUnixOutputs(const char *stdoutPath,const char *stderrPath = (const char *)0)
+ throw();
+#endif
+
/**
* Perform a time-invariant binary comparison
*