X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Fexim_lock.c;h=37d9744771217b245aaf386faf3d337524984c08;hb=c9068a49f52c7b42b49944852d6b93e95abb71dc;hp=f783a2bcf781cbcb8067105f1437ff955824767f;hpb=1ba28e2b955b005ce4825fec792df17f75a8de1e;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/exim_lock.c b/src/src/exim_lock.c index f783a2bcf..37d974477 100644 --- a/src/src/exim_lock.c +++ b/src/src/exim_lock.c @@ -1,5 +1,3 @@ -/* $Cambridge: exim/src/src/exim_lock.c,v 1.4 2010/05/29 12:11:48 pdp Exp $ */ - /* A program to lock a file exactly as Exim would, for investigation of interlocking problems. @@ -72,6 +70,10 @@ the other stuff in os.c, so force the other macros to omit it. */ #define FIND_RUNNING_INTERFACES #endif +#ifndef OS_GET_DNS_RESOLVER_RES + #define OS_GET_DNS_RESOLVER_RES +#endif + #include "../src/os.c" @@ -173,7 +175,7 @@ int fd = -1; int hd = -1; int md = -1; int yield = 0; -int now = time(NULL); +time_t now = time(NULL); BOOL use_lockfile = FALSE; BOOL use_fcntl = FALSE; BOOL use_flock = FALSE; @@ -298,8 +300,10 @@ if (use_lockfile) lockname = malloc(len + 8); sprintf(lockname, "%s.lock", filename); hitchname = malloc(len + 32 + (int)strlen(primary_hostname)); + + /* Presumably, this must match appendfile.c */ sprintf(hitchname, "%s.%s.%08x.%08x", lockname, primary_hostname, - now, (int)getpid()); + (unsigned int)now, (unsigned int)getpid()); if (verbose) printf("exim_lock: lockname = %s\n hitchname = %s\n", lockname, @@ -581,12 +585,14 @@ if (restore_times) struct stat strestore; struct utimbuf ut; stat(filename, &strestore); - (void)system(command); + i = system(command); ut.actime = strestore.st_atime; ut.modtime = strestore.st_mtime; utime(filename, &ut); } -else (void)system(command); +else i = system(command); + +if(i && !quiet) printf("warning: nonzero status %d\n", i); /* Remove the locks and exit. Unlink the /tmp file if we can get an exclusive lock on the mailbox. This should be a non-blocking lock call, as there is no