2009-06-21 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Call daemon() with arguments(0,0), which means daemon() changes
	current working directory to / and redirects stdin, stdout and
	stderr to /dev/null.
	* src/option_processing.cc
pull/1/head
Tatsuhiro Tsujikawa 2009-06-20 16:17:00 +00:00
parent 3177b0aa1c
commit 3636345a25
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2009-06-21 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Call daemon() with arguments(0,0), which means daemon() changes
current working directory to / and redirects stdin, stdout and
stderr to /dev/null.
* src/option_processing.cc
2009-06-21 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Small performance optimizations.

View File

@ -191,7 +191,7 @@ void option_processing(Option& op, std::deque<std::string>& uris,
}
#ifdef HAVE_DAEMON
if(op.getAsBool(PREF_DAEMON)) {
if(daemon(1, 1) < 0) {
if(daemon(0, 0) < 0) {
perror(MSG_DAEMON_FAILED);
exit(DownloadResult::UNKNOWN_ERROR);
}