]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
Redirect standard streams if backgrounding was requested even if the fork failed
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 20 Jul 2006 17:47:13 +0000 (17:47 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 20 Jul 2006 17:47:13 +0000 (17:47 +0000)
lib/rbot/ircbot.rb

index 88a8548367956a62e03753149bb8730dea922854..8233f3c580d65f1084a5ee083992f66b101b6a73 100644 (file)
@@ -190,16 +190,12 @@ class IrcBot
         exit if fork
       rescue NotImplementedError
         puts "Could not background, fork not supported"
-        $daemonize = false
       rescue => e
         puts "Could not background. #{e.inspect}"
-        $daemonize = false
       end
-    end
-
-    if $daemonize
       Dir.chdir botclass
       # File.umask 0000                # Ensure sensible umask. Adjust as needed.
+      puts "Redirecting standard input/output/error"
       begin
         STDIN.reopen "/dev/null"
       rescue Errno::ENOENT