From 485776ce70e37ecfa56740ae02ce11586b8686d9 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Thu, 20 Jul 2006 17:47:13 +0000 Subject: Redirect standard streams if backgrounding was requested even if the fork failed --- lib/rbot/ircbot.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb index 88a85483..8233f3c5 100644 --- a/lib/rbot/ircbot.rb +++ b/lib/rbot/ircbot.rb @@ -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 -- cgit v1.2.3