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.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 'src/mds.c')
-rw-r--r-- | src/mds.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -139,11 +139,11 @@ int main(int argc_, char** argv_) continue; } r = is_pid_file_reusable(f); - fclose(f); + xfclose(f); if (r == 0) continue; } - close(fd); + xclose(fd); break; } exit_if (display == DISPLAY_MAX, @@ -155,11 +155,11 @@ int main(int argc_, char** argv_) xsnprintf(piddata, "%u\n", getpid()); if (fwrite(piddata, 1, strlen(piddata), f) < strlen(piddata)) { - fclose(f); + xfclose(f); fail_if (1); } fflush(f); - fclose(f); + xfclose(f); if (chmod(pathname, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) < 0) xperror(*argv); @@ -202,7 +202,7 @@ int main(int argc_, char** argv_) if (fd != -1) { shutdown(fd, SHUT_RDWR); - close(fd); + xclose(fd); unlink(pathname); } |