Do lock failures slightly better, return a special value so we don't

unlink the wrong thing.
This commit is contained in:
nicm
2015-11-24 23:01:51 +00:00
parent 73e30cbda8
commit dca93c56e0
2 changed files with 23 additions and 19 deletions

View File

@ -195,9 +195,11 @@ server_start(struct event_base *base, int lockfd, char *lockfile)
server_update_socket();
server_client_create(pair[1]);
unlink(lockfile);
free(lockfile);
close(lockfd);
if (lockfd >= 0) {
unlink(lockfile);
free(lockfile);
close(lockfd);
}
start_cfg();