From 16b25c8a426c285c85c24db115c677218d287da9 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 21 Aug 2015 20:43:01 +0200 Subject: add and use xclose and xfclose, we do not want close or fclose to be ignored because a singal interrupts it. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mds-base.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/mds-base.c') diff --git a/src/mds-base.c b/src/mds-base.c index 79a3ba4..2220003 100644 --- a/src/mds-base.c +++ b/src/mds-base.c @@ -187,7 +187,7 @@ int __attribute__((weak)) connect_to_display(void) fail: xperror(*argv); if (socket_fd >= 0) - close(socket_fd); + xclose(socket_fd); return 1; } @@ -422,7 +422,7 @@ static int base_unmarshal(void) fail_if ((state_buf = state_buf_ = full_read(reexec_fd, NULL)) == NULL); /* Release resources. */ - close(reexec_fd); + xclose(reexec_fd); shm_unlink(shm_path); @@ -509,7 +509,7 @@ static void perform_reexec(void) reexec_fd = shm_open(shm_path, O_RDWR | O_CREAT | O_EXCL, S_IRWXU); fail_if (reexec_fd < 0); fail_if (base_marshal(reexec_fd) < 0); - close(reexec_fd); + xclose(reexec_fd); reexec_fd = -1; /* Re-exec the server. */ @@ -519,7 +519,7 @@ static void perform_reexec(void) xperror(*argv); if (reexec_fd >= 0) { - close(reexec_fd); + xclose(reexec_fd); shm_unlink(shm_path); } } @@ -597,14 +597,14 @@ int main(int argc_, char** argv_) fail_if (1); } - close(socket_fd); + xclose(socket_fd); return 0; fail: xperror(*argv); if (socket_fd >= 0) - close(socket_fd); + xclose(socket_fd); return 1; } -- cgit v1.2.3-70-g09d2