Skip to content

Commit 12e7c55

Browse files
committed
Ignore macOS daemon() depracation warning
1 parent 0a8054e commit 12e7c55

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)