diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-08-21 20:43:01 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-08-21 20:43:01 +0200 |
commit | 16b25c8a426c285c85c24db115c677218d287da9 (patch) | |
tree | 7712ef9bc069da7836bcf492edc5ca915d8ceb5e /src/mds-base.c | |
parent | m info (diff) | |
download | mds-16b25c8a426c285c85c24db115c677218d287da9.tar.gz mds-16b25c8a426c285c85c24db115c677218d287da9.tar.bz2 mds-16b25c8a426c285c85c24db115c677218d287da9.tar.xz |
add and use xclose and xfclose, we do not want close or fclose to be ignored because a singal interrupts it.
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | src/mds-base.c | 12 |
1 files changed, 6 insertions, 6 deletions
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; } |