diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-03-30 05:00:15 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-03-30 05:00:15 +0000 |
commit | 635bdf6f13712b7bb536a469734a5b4446e1923e (patch) | |
tree | d6a1c437145e968d805bd786c66ffb6d7a135c5d /process.c | |
parent | 4a6acc26d5fb95ae9990aefdc6d590769be97935 (diff) |
* process.c (proc_daemon): Process.daemon should raise an error on
failure regardless of whether the implementation uses daemon(3)
or not. [ruby-dev:40832]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r-- | process.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -4531,8 +4531,8 @@ proc_setmaxgroups(VALUE obj, VALUE val) #if defined(HAVE_DAEMON) || defined(HAVE_FORK) /* * call-seq: - * Process.daemon() => fixnum - * Process.daemon(nochdir=nil,noclose=nil) => fixnum + * Process.daemon() => 0 + * Process.daemon(nochdir=nil,noclose=nil) => 0 * * Detach the process from controlling terminal and run in * the background as system daemon. Unless the argument @@ -4540,6 +4540,7 @@ proc_setmaxgroups(VALUE obj, VALUE val) * working directory to the root ("/"). Unless the argument * noclose is true, daemon() will redirect standard input, * standard output and standard error to /dev/null. + * Return zero on success, or raise one of Errno::*. */ static VALUE @@ -4561,7 +4562,7 @@ proc_daemon(int argc, VALUE *argv) #elif defined(HAVE_FORK) switch (rb_fork(0, 0, 0, Qnil)) { case -1: - return INT2FIX(-1); + rb_sys_fail("daemon"); case 0: break; default: @@ -4573,7 +4574,7 @@ proc_daemon(int argc, VALUE *argv) /* must not be process-leader */ switch (rb_fork(0, 0, 0, Qnil)) { case -1: - return INT2FIX(-1); + rb_sys_fail("daemon"); case 0: break; default: |