Skip to content

Commit 807d2ac

Browse files
committed
Merge #12941: [Trivial] Ignore macOS daemon() depracation warning
12e7c55 Ignore macOS daemon() depracation warning (Jonas Schnelli) Pull request description: `daemon()` is deprecated on OSX since 10.5 (should migrate to `posix_spawn()`). There are no signs `daemon()` will get removed by Apple. Tree-SHA512: d5bcdc5d6b507576e0358906a73f9c766f2072f4a9aef6bdc559e10dbec95337ffa50a1ccb60f7197591e2e74f87c74c13387de880aaedc6dbf3796253f69561
2 parents 9b3370d + 12e7c55 commit 807d2ac

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/bitcoind.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,20 @@ bool AppInit(int argc, char* argv[])
139139
if (gArgs.GetBoolArg("-daemon", false))
140140
{
141141
#if HAVE_DECL_DAEMON
142+
#if defined(MAC_OSX)
143+
#pragma GCC diagnostic push
144+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
145+
#endif
142146
fprintf(stdout, "Bitcoin server starting\n");
143147

144148
// Daemonize
145149
if (daemon(1, 0)) { // don't chdir (1), do close FDs (0)
146150
fprintf(stderr, "Error: daemon() failed: %s\n", strerror(errno));
147151
return false;
148152
}
153+
#if defined(MAC_OSX)
154+
#pragma GCC diagnostic pop
155+
#endif
149156
#else
150157
fprintf(stderr, "Error: -daemon is not supported on this operating system\n");
151158
return false;

0 commit comments

Comments
 (0)