diff options
author | Kenneth G Raeburn <raeburn@mit.edu> | 1991-03-08 06:21:05 +0000 |
---|---|---|
committer | Kenneth G Raeburn <raeburn@mit.edu> | 1991-03-08 06:21:05 +0000 |
commit | b504de9bd8d99793f32040649f55a2f131e07616 (patch) | |
tree | f6dd8faec59aa9d3a83f76feb3f24017dcd15aad | |
parent | e72926c7d4c81a236c0e9bfddb48d370f1283622 (diff) |
If NO_FLOCK is defined, don't call flock.
-rw-r--r-- | clients/zmailnotify/zmailnotify.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clients/zmailnotify/zmailnotify.c b/clients/zmailnotify/zmailnotify.c index f894483..35e3be4 100644 --- a/clients/zmailnotify/zmailnotify.c +++ b/clients/zmailnotify/zmailnotify.c @@ -122,8 +122,10 @@ main(argc, argv) } lock = fopen(lockfile,"r"); +#ifndef NO_FLOCK if (lock) (void) flock(fileno(lock),LOCK_EX); +#endif if (pop_init(host) == NOTOK) { fprintf(stderr,"%s: %s\n",prog, Errmsg); @@ -150,7 +152,9 @@ main(argc, argv) if (!nmsgs) { if (lock) { +#ifndef NO_FLOCK (void) flock(fileno(lock),LOCK_UN); +#endif (void) fclose(lock); } (void) unlink(lockfile); @@ -180,8 +184,10 @@ main(argc, argv) } else { lock = fopen(lockfile,"w"); +#ifndef NO_FLOCK if (lock) (void) flock(fileno(lock),LOCK_EX); +#endif uselock = 0; } @@ -204,7 +210,9 @@ main(argc, argv) mail_notify(&maillist[nmsgs-i]); i--; if (lock) { +#ifndef NO_FLOCK (void) flock(fileno(lock),LOCK_UN); +#endif (void) fclose(lock); } lock = fopen(lockfile,"w"); |