X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/177f020f122827214159c46dcfe7ded1e3c8d1c3..c3238c0e:/uip/dropsbr.c?ds=sidebyside diff --git a/uip/dropsbr.c b/uip/dropsbr.c index a02e29c4..3109bcf7 100644 --- a/uip/dropsbr.c +++ b/uip/dropsbr.c @@ -46,19 +46,16 @@ mbx_open (char *file, int mbx_style, uid_t uid, gid_t gid, mode_t mode) /* attempt to open and lock file */ for (count = 4; count > 0; count--) { int failed_to_lock = 0; - if ((fd = lkopenspool (file, O_RDWR | O_CREAT | - O_NONBLOCK, mode, &failed_to_lock)) == NOTOK) { - if (failed_to_lock) { - j = errno; - sleep (5); - continue; - } else { - return NOTOK; - } - } - /* good file descriptor */ - break; + if ((fd = lkopenspool (file, O_RDWR | O_CREAT | O_NONBLOCK, + mode, &failed_to_lock)) != NOTOK) + break; + + if (!failed_to_lock) + return NOTOK; + + j = errno; + sleep (5); } errno = j;