[Orca-checkins] r525 - orca/trunk/orca

blair at orcaware.com blair at orcaware.com
Wed Feb 1 21:26:07 PST 2006


Author: blair at orcaware.com
Date: Wed Feb  1 21:25:42 2006
New Revision: 525

Modified:
   orca/trunk/orca/orca.pl.in

Log:
Fix a comment and style issue in Orca on the daemonizing code.

* orca/orca.pl.in
  (main):
    Remove a comment that POSIX::setsid() is not needed to daemonize
      Orca and that Orca doesn't need to quit.  Orca has always quit
      if POSIX::setsid() isn't found.
    Add 0 as an argument to exit().


Modified: orca/trunk/orca/orca.pl.in
==============================================================================
--- orca/trunk/orca/orca.pl.in	(original)
+++ orca/trunk/orca/orca.pl.in	Wed Feb  1 21:25:42 2006
@@ -202,9 +202,7 @@
     die "$0: cannot open '$opt_log_filename' for writing: $!\n";
 }
 
-# If Orca should daemonize itself, then do so now.  Find POSIX::setsid
-# but do not always use it unless it is needed since some systems do
-# not supply POSIX::setsid and Orca should not quit on those systems.
+# If Orca should daemonize itself, then do so now.
 if ($opt_daemon) {
   my $expr = 'use POSIX qw(setsid)';
   local $SIG{__DIE__}  = 'DEFAULT';
@@ -214,9 +212,9 @@
     die "$0: cannot get setsid since eval '$expr' failed: $@\n";
   }
   chdir('/')               or die "$0: cannot chdir '/': $!\n";
-  open(STDIN, '/dev/null') or die "$0: cannot read '/dev/null': $!\n";
+  open(STDIN, '/dev/null') or die "$0: cannot open '/dev/null': $!\n";
   defined(my $pid = fork)  or die "$0: cannot fork: $!\n";
-  exit if $pid;
+  exit(0) if $pid;
   POSIX::setsid()          or die "$0: cannot start a new session: $!\n";
 }
 



More information about the Orca-checkins mailing list