mirror of
https://github.com/monero-project/monero.git
synced 2024-12-23 12:09:54 +00:00
Merge pull request #6149
4dc4e1f
Fix #6147 DB corruption from child process overwrite (hyc)
This commit is contained in:
commit
c3a413bd42
1 changed files with 6 additions and 1 deletions
|
@ -127,13 +127,18 @@ void fork(const std::string & pidfile)
|
||||||
{
|
{
|
||||||
quit("Unable to open output file: " + output);
|
quit("Unable to open output file: " + output);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
if (open("/dev/null", O_WRONLY) < 0)
|
||||||
|
{
|
||||||
|
quit("Unable to open /dev/null");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Also send standard error to the same log file.
|
// Also send standard error to the same log file.
|
||||||
if (dup(1) < 0)
|
if (dup(1) < 0)
|
||||||
{
|
{
|
||||||
quit("Unable to dup output descriptor");
|
quit("Unable to dup output descriptor");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace posix
|
} // namespace posix
|
||||||
|
|
Loading…
Reference in a new issue