summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/run.c
diff options
context:
space:
mode:
authorAnand Avati <avati@redhat.com>2012-09-20 00:30:39 -0700
committerAnand Avati <avati@redhat.com>2012-09-20 10:52:32 -0700
commite31a5847e269d865b7248554e328bc9ac358454a (patch)
treed9336ef551480d7556e2ed502af1872d5a3c266b /libglusterfs/src/run.c
parent2fc6834e7a5d721e97a47f3ebaa201902af73c5a (diff)
runner: introduce a new variant runner_run_nowait()
which makes the child blindly _exit(0) (thereby relieving the caller quickly) and the grandchild continues to actually do execvp(). Change-Id: I4dac0f39aaaa5b2ae5dbeb96e221b8257f8d3a22 BUG: 762935 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/3962 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Csaba Henk <csaba@redhat.com>
Diffstat (limited to 'libglusterfs/src/run.c')
-rw-r--r--libglusterfs/src/run.c19
1 files changed, 19 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)
{