dma: don't block on lock/opening the mbox file, backoff instead
authorSimon Schubert <corecode@dragonflybsd.org>
Tue, 21 Jul 2009 23:20:54 +0000 (01:20 +0200)
committerSimon Schubert <corecode@dragonflybsd.org>
Tue, 21 Jul 2009 23:20:54 +0000 (01:20 +0200)
libexec/dma/local.c

index 5515177..109bd2b 100644 (file)
@@ -30,7 +30,7 @@ deliver_local(struct qitem *it, const char **errmsg)
        }
 
        /* mailx removes users mailspool file if empty, so open with O_CREAT */
-       mbox = open_locked(fn, O_WRONLY | O_APPEND | O_CREAT);
+       mbox = open_locked(fn, O_WRONLY|O_APPEND|O_NONBLOCK|O_CREAT, 0660);
        if (mbox < 0) {
                syslog(LOG_NOTICE, "local delivery deferred: can not open `%s': %m", fn);
                return (1);