From 2ac549c681ec953f0dacb056de51d2e650113578 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 28 Dec 2015 16:23:09 +0100 Subject: close state file + unlink before closing to avoid race condition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/satd-diminished.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/satd-diminished.c') diff --git a/src/satd-diminished.c b/src/satd-diminished.c index 632e29b..48ada56 100644 --- a/src/satd-diminished.c +++ b/src/satd-diminished.c @@ -76,9 +76,10 @@ main(int argc, char *argv[]) shutdown(fd, SHUT_RDWR); close(fd); - close(SOCK_FILENO); unlink(argv[1]); unlink(argv[2]); /* Only on success! */ + close(SOCK_FILENO); + close(STATE_FILENO); return 0; (void) argc; } -- cgit v1.2.3-70-g09d2