소스 검색

Truncate the pid file when opening it. Now it actually will contain the pid

of the btpd process :)
master
Richard Nyberg 18 년 전
부모
커밋
2e073c13f2
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. +1
    -1
      btpd/main.c

+ 1
- 1
btpd/main.c 파일 보기

@@ -49,7 +49,7 @@ setup_daemon(int daemonize, const char *dir, const char *log)
if (mkdir("torrents", 0777) == -1 && errno != EEXIST)
err(1, "Couldn't create torrents subdir");

if ((pidfd = open("pid", O_CREAT|O_WRONLY, 0666)) == -1)
if ((pidfd = open("pid", O_CREAT|O_TRUNC|O_WRONLY, 0666)) == -1)
err(1, "Couldn't open 'pid'");

if (flock(pidfd, LOCK_NB|LOCK_EX) == -1)


불러오는 중...
취소
저장