X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/b0fa97c1588ce368d0fd490472d2a7f552c45dbf..a5c60e3c951f141cfd38ac1d05eea15743206c9a:/src/src/exim_lock.c diff --git a/src/src/exim_lock.c b/src/src/exim_lock.c index 074a951d1..068216816 100644 --- a/src/src/exim_lock.c +++ b/src/src/exim_lock.c @@ -588,12 +588,24 @@ if (restore_times) int fd = open(filename, O_RDWR); /* use fd for both get & restore */ struct timespec tt[2]; - fstat(fd, &strestore); + if (fd < 0) + { + printf("open '%s': %s\n", filename, strerror(errno)); + yield = 1; + goto CLEAN_UP; + } + if (fstat(fd, &strestore) != 0) + { + printf("fstat '%s': %s\n", filename, strerror(errno)); + yield = 1; + close(fd); + goto CLEAN_UP; + } i = system(command); tt[0] = strestore.st_atim; tt[1] = strestore.st_mtim; - futimens(fd, tt); - close(fd); + (void) futimens(fd, tt); + (void) close(fd); #else struct utimbuf ut;