X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/025153a3cc83c227e9a3dec95b94eb56dd5e3c58..92128dac:/uip/slocal.c?ds=inline diff --git a/uip/slocal.c b/uip/slocal.c index fb21c880..8afef253 100644 --- a/uip/slocal.c +++ b/uip/slocal.c @@ -183,7 +183,7 @@ int main (int argc, char **argv) { int fd, status; - FILE *fp = stdin; + FILE *fp; char *cp, *mdlvr = NULL, buf[BUFSIZ]; char mailbox[BUFSIZ], tmpfil[BUFSIZ]; char **argp, **arguments; @@ -1414,6 +1414,7 @@ suppress_duplicates (int fd, char *file) rewind (in); for (;;) { + int failed_to_lock = 0; int bufsz = sizeof buf; state = m_getfld (&gstate, name, buf, &bufsz, in); switch (state) { @@ -1451,7 +1452,8 @@ suppress_duplicates (int fd, char *file) * This will fail if your Maildelivery file doesn't * exist. */ - if ((lockfd = lkopendata(file, O_RDWR, 0)) == -1) { + if ((lockfd = lkopendata(file, O_RDWR, 0, &failed_to_lock)) + == -1) { advise (file, "unable to perform file locking on"); free (cp); fclose (in);