Fix nbd log
This commit is contained in:
+4
-4
@@ -369,14 +369,14 @@ public:
|
|||||||
setsid();
|
setsid();
|
||||||
if (fork())
|
if (fork())
|
||||||
exit(0);
|
exit(0);
|
||||||
if (chdir("/") != 0)
|
|
||||||
fprintf(stderr, "Warning: Failed to chdir into /\n");
|
|
||||||
close(0);
|
close(0);
|
||||||
close(1);
|
close(1);
|
||||||
close(2);
|
close(2);
|
||||||
open("/dev/null", O_RDONLY);
|
open("/dev/null", O_RDONLY);
|
||||||
open(logfile.c_str(), O_WRONLY|O_APPEND|O_CREAT);
|
open(logfile.c_str(), O_WRONLY|O_APPEND|O_CREAT, 0666);
|
||||||
open(logfile.c_str(), O_WRONLY|O_APPEND|O_CREAT);
|
open(logfile.c_str(), O_WRONLY|O_APPEND|O_CREAT, 0666);
|
||||||
|
if (chdir("/") != 0)
|
||||||
|
fprintf(stderr, "Warning: Failed to chdir into /\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
json11::Json::object list_mapped()
|
json11::Json::object list_mapped()
|
||||||
|
|||||||
Reference in New Issue
Block a user