mirror of https://github.com/aria2/aria2
Silence deprecation warning about daemon() on OSX
parent
b9fe4119c0
commit
3c55400d23
|
@ -311,7 +311,18 @@ error_code::Value option_processing(Option& op, bool standalone,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(standalone && op.getAsBool(PREF_DAEMON)) {
|
if(standalone && op.getAsBool(PREF_DAEMON)) {
|
||||||
if(daemon(0, 0) < 0) {
|
#if defined(__GNUC__) && defined(__APPLE__)
|
||||||
|
// daemon() is deprecated on OSX since... forever.
|
||||||
|
// Silence the warning for good, so that -Werror becomes feasible.
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||||
|
#endif // defined(__GNUC__) && defined(__APPLE__)
|
||||||
|
const auto daemonized = daemon(0, 0);
|
||||||
|
#if defined(__GNUC__) && defined(__APPLE__)
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif // defined(__GNUC__) && defined(__APPLE__)
|
||||||
|
|
||||||
|
if(daemonized < 0) {
|
||||||
perror(MSG_DAEMON_FAILED);
|
perror(MSG_DAEMON_FAILED);
|
||||||
return error_code::UNKNOWN_ERROR;
|
return error_code::UNKNOWN_ERROR;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue