提交 99800e54 编写于 作者: J Jiri Denemark

daemon: Change CWD to / before daemonizing

We were doing so for child processes but not for libvirtd itself.
上级 e3fb2908
......@@ -3175,6 +3175,13 @@ int main(int argc, char **argv) {
if (godaemon) {
char ebuf[1024];
if (chdir("/") < 0) {
VIR_ERROR(_("cannot change to root directory: %s"),
virStrerror(errno, ebuf, sizeof(ebuf)));
goto error;
}
if ((statuswrite = daemonForkIntoBackground()) < 0) {
VIR_ERROR(_("Failed to fork as daemon: %s"),
virStrerror(errno, ebuf, sizeof ebuf));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册