summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/run.c19
-rw-r--r--libglusterfs/src/run.h6
2 files changed, 25 insertions, 0 deletions
diff --git a/libglusterfs/src/run.c b/libglusterfs/src/run.c
index 50c1e30bf..94511b1c3 100644
--- a/libglusterfs/src/run.c
+++ b/libglusterfs/src/run.c
@@ -392,6 +392,25 @@ runner_run (runner_t *runner)
return runner_run_generic (runner, runner_end);
}
+
+int
+runner_run_nowait (runner_t *runner)
+{
+ int pid;
+
+ pid = fork ();
+
+ if (!pid) {
+ setsid ();
+ _exit (runner_start (runner));
+ }
+
+ if (pid > 0)
+ runner->chpid = pid;
+ return runner_end (runner);
+}
+
+
int
runner_run_reuse (runner_t *runner)
{
diff --git a/libglusterfs/src/run.h b/libglusterfs/src/run.h
index 508c59c13..d7554ef6d 100644
--- a/libglusterfs/src/run.h
+++ b/libglusterfs/src/run.h
@@ -166,6 +166,12 @@ int runner_end_reuse (runner_t *runner);
int runner_run (runner_t *runner);
/**
+ * variant for runner_run() which does not wait for acknowledgement
+ * from child, and always assumes it succeeds.
+ */
+int runner_run_nowait (runner_t *runner);
+
+/**
* variant of runner_run() which does not free internal data
* so that the runner instance can be run again.
*