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)
libexec/dma/spool.c

index 8489234..ae3c987 100644 (file)
@@ -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 */