Fix nbd log

nfs-proxy-old
Vitaliy Filippov 2022-04-06 02:04:39 +03:00
parent 3615e57879
commit c373425562
1 changed files with 4 additions and 4 deletions

View File

@ -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()