smartdns: support no create pid file.

This commit is contained in:
Nick Peng
2022-08-05 22:13:26 +08:00
parent 6588c9822f
commit 3605e6ed71

View File

@@ -132,7 +132,7 @@ static void _help(void)
"Start smartdns server.\n"
" -f run forground.\n"
" -c [conf] config file.\n"
" -p [pid] pid file path\n"
" -p [pid] pid file path, '-' means don't create pid file.\n"
" -S ignore segment fault signal.\n"
" -x verbose screen.\n"
" -v dispaly version.\n"
@@ -571,7 +571,7 @@ int main(int argc, char *argv[])
_reg_signal();
}
if (create_pid_file(pid_file) != 0) {
if (strncmp(pid_file, "-", 2) != 0 && create_pid_file(pid_file) != 0) {
goto errout;
}