X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fsrc%2Fexim_lock.c;h=068216816054e832085d9cb035daa8ae50f12ba8;hb=c05bdbd6fcc573e071652f88b468091f57a0430d;hp=074a951d1036b9c3b15a01bf8d49df833293391f;hpb=b0fa97c1588ce368d0fd490472d2a7f552c45dbf;p=exim.git 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;