]> git.ipfire.org Git - people/ms/dma.git/commitdiff
dma: correct logic for setting the locked flag
authorSimon Schubert <corecode@dragonflybsd.org>
Mon, 20 Jul 2009 11:33:09 +0000 (13:33 +0200)
committerSimon Schubert <corecode@dragonflybsd.org>
Tue, 21 Jul 2009 22:13:15 +0000 (00:13 +0200)
spool.c

diff --git a/spool.c b/spool.c
index 84892348132289bddd79a147b9bd14f091fd8c3f..ae3c9879a3fac919422f2f346ec5c20e2933ab6a 100644 (file)
--- a/spool.c
+++ b/spool.c
@@ -227,9 +227,11 @@ load_queue(struct queue *queue, int ignorelock)
                        goto fail;
 
                fd = open_locked(queuefn, O_RDONLY|O_NONBLOCK);
-               if (ignorelock && fd < 0) {
-                       fd = open(queuefn, O_RDONLY);
-                       locked = 0;
+               if (ignorelock) {
+                       if (fd < 0)
+                               fd = open(queuefn, O_RDONLY);
+                       else
+                               locked = 0;
                }
                if (fd < 0) {
                        /* Ignore locked files */