Support bogus subnet search

This commit is contained in:
Nick Peng
2018-12-06 00:14:41 +08:00
parent 51dad486b8
commit 39f6b98bc0
7 changed files with 979 additions and 16 deletions

View File

@@ -138,19 +138,19 @@ int create_pid_file(const char *pid_file)
/* create pid file, and lock this file */
fd = open(pid_file, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
if (fd == -1) {
fprintf(stderr, "create pid file failed, %s", strerror(errno));
fprintf(stderr, "create pid file failed, %s\n", strerror(errno));
return -1;
}
flags = fcntl(fd, F_GETFD);
if (flags < 0) {
fprintf(stderr, "Could not get flags for PID file %s", pid_file);
fprintf(stderr, "Could not get flags for PID file %s\n", pid_file);
goto errout;
}
flags |= FD_CLOEXEC;
if (fcntl(fd, F_SETFD, flags) == -1) {
fprintf(stderr, "Could not set flags for PID file %s", pid_file);
fprintf(stderr, "Could not set flags for PID file %s\n", pid_file);
goto errout;
}
@@ -326,7 +326,6 @@ int main(int argc, char *argv[])
}
if (create_pid_file(pid_file) != 0) {
fprintf(stderr, "create pid file failed, %s\n", strerror(errno));
goto errout;
}