log_get_progname(), map_file, strerror(errno));
exit(EXIT_FAILURE);
}
- close(fd);
+ if (close(fd) != 0 && errno != EINTR) {
+ fprintf(log_get_logfd(), _("%s: closing %s failed: %s\n"),
+ log_get_progname(), map_file, strerror(errno));
+ exit(EXIT_FAILURE);
+ }
free(buf);
}
Prog, (unsigned long) uid, strerror (errno));
SYSLOG ((LOG_WARN, "failed to reset the faillog entry of UID %lu", (unsigned long) uid));
}
- if (close (fd) != 0) {
+ if (close (fd) != 0 && errno != EINTR) {
fprintf (stderr,
_("%s: failed to close the faillog file for UID %lu: %s\n"),
Prog, (unsigned long) uid, strerror (errno));
SYSLOG ((LOG_WARN, "failed to reset the lastlog entry of UID %lu", (unsigned long) uid));
/* continue */
}
- if (close (fd) != 0) {
+ if (close (fd) != 0 && errno != EINTR) {
fprintf (stderr,
_("%s: failed to close the lastlog file for UID %lu: %s\n"),
Prog, (unsigned long) uid, strerror (errno));
perror(_("Setting mailbox file permissions"));
}
- fsync(fd);
- close(fd);
+ if (fsync(fd) != 0) {
+ perror (_("Synchronize mailbox file"));
+ }
+ if (close(fd) != 0 && errno != EINTR) {
+ perror (_("Closing mailbox file"));
+ }
#ifdef WITH_SELINUX
/* Reset SELinux to create files with default contexts */
if (reset_selinux_file_context() != 0) {
}
}
- (void) close (fd);
+ if (close (fd) != 0 && errno != EINTR) {
+ fprintf (stderr,
+ _("%s: failed to copy the lastlog entry of user %ju to user %ju: %s\n"),
+ Prog, (uintmax_t) user_id, (uintmax_t) user_newid, strerror (errno));
+ }
}
#endif /* ENABLE_LASTLOG */
}
}
- (void) close (fd);
+ if (close (fd) != 0 && errno != EINTR) {
+ fprintf (stderr,
+ _("%s: failed to copy the faillog entry of user %ju to user %ju: %s\n"),
+ Prog, (uintmax_t) user_id, (uintmax_t) user_newid, strerror (errno));
+ }
}
#ifndef NO_MOVE_MAILBOX