From 61abcf71c05c07bfaca96666b16a0bc30a6edab4 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 19 Jan 2012 11:30:23 +0000 Subject: daemon: pwrite/pread: Don't double close on error path. In Linux, close (fd) closes the file descriptor even if it returns an error. --- daemon/file.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/daemon/file.c b/daemon/file.c index e0f87948..91746e0d 100644 --- a/daemon/file.c +++ b/daemon/file.c @@ -483,7 +483,6 @@ pread_fd (int fd, int count, int64_t offset, size_t *size_r, if (close (fd) == -1) { reply_with_perror ("close: %s", display_path); - close (fd); free (buf); return NULL; } @@ -539,7 +538,6 @@ pwrite_fd (int fd, const char *content, size_t size, int64_t offset, if (close (fd) == -1) { reply_with_perror ("close: %s", display_path); - close (fd); return -1; } -- cgit