]> diplodocus.org Git - nmh/blobdiff - uip/new.c
lkopen_dot() would block forever if another process held a lock
[nmh] / uip / new.c
index a0683dd..8d235b1 100644 (file)
--- a/uip/new.c
+++ b/uip/new.c
@@ -95,6 +95,7 @@ get_msgnums(char *folder, char *sequences[])
     char name[NAMESZ], field[BUFSIZ];
     char *cp;
     char *msgnums = NULL, *this_msgnums, *old_msgnums;
+    int failed_to_lock = 0;
     m_getfld_state_t gstate = 0;
 
     /* copied from seq_read.c:seq_public */
@@ -112,11 +113,10 @@ get_msgnums(char *folder, char *sequences[])
     if (seqfile == NULL)
        return NULL;
 
-    if ((fp = lkfopendata (seqfile, "r")) == NULL) {
+    if ((fp = lkfopendata (seqfile, "r", & failed_to_lock)) == NULL) {
        free(seqfile);
 
-       if (errno == EACCES  ||  errno == EAGAIN  ||  errno == EWOULDBLOCK) {
-           /* Failed to lock sequence file. */
+       if (failed_to_lock) {
            adios (seqfile, "failed to lock");
        } else {
            return NULL;