aboutsummaryrefslogtreecommitdiffstats
path: root/src/mds.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-08-21 20:43:01 +0200
committerMattias Andrée <maandree@operamail.com>2015-08-21 20:43:01 +0200
commit16b25c8a426c285c85c24db115c677218d287da9 (patch)
tree7712ef9bc069da7836bcf492edc5ca915d8ceb5e /src/mds.c
parentm info (diff)
downloadmds-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.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mds.c b/src/mds.c
index cb39005..05a0758 100644
--- a/src/mds.c
+++ b/src/mds.c
@@ -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);
}