瀏覽代碼

smartdns: support no create pid file.

Nick Peng 3 年之前
父節點
當前提交
3605e6ed71
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/smartdns.c

+ 2 - 2
src/smartdns.c

@@ -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;
 	}