diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-09-19 09:05:20 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-09-19 09:05:20 +0000 |
| commit | 6293908a9d6d107f86110c1e076bc42cead258e6 (patch) | |
| tree | 5dc23a118d2049e965741243b3dd67276cc63ee2 /src/option_processing.cc | |
| parent | f0d2be6120224e680106dfbf39439b233abc6619 (diff) | |
2009-09-19 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added our own daemon() function for systems which desn't have
daemon(3).
* configure.ac
* src/Makefile.am
* src/daemon.cc
* src/daemon.h
* src/option_processing.cc
Diffstat (limited to 'src/option_processing.cc')
| -rw-r--r-- | src/option_processing.cc | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/option_processing.cc b/src/option_processing.cc index 965a55a8..3f37ad53 100644 --- a/src/option_processing.cc +++ b/src/option_processing.cc @@ -56,6 +56,9 @@ #include "DownloadResultCode.h" #include "SimpleRandomizer.h" #include "bittorrent_helper.h" +#ifndef HAVE_DAEMON +#include "daemon.h" +#endif // !HAVE_DAEMON namespace aria2 { @@ -191,19 +194,12 @@ void option_processing(Option& op, std::deque<std::string>& uris, exit(downloadresultcode::UNKNOWN_ERROR); } } -#ifdef HAVE_DAEMON if(op.getAsBool(PREF_DAEMON)) { - if(File::getCurrentDir() == ".") { - std::cerr << "Failed to get the current working directory." - << " With -D option engaged," - << " the default value of --dir option is /." << std::endl; - } if(daemon(0, 0) < 0) { perror(MSG_DAEMON_FAILED); exit(downloadresultcode::UNKNOWN_ERROR); } } -#endif // HAVE_DAEMON } } // namespace aria2 |
