From: Simon Schubert Date: Tue, 21 Jul 2009 23:21:44 +0000 (+0200) Subject: dma: don't block when trying to aquire a queue file X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e4fa698d616a511a80b5ce585375941b45e4511;p=people%2Fms%2Fdma.git dma: don't block when trying to aquire a queue file We might race with some other process, so it is imperative to treat a locked file as a soft error instead of blocking on the file until the other process unlocks it. --- diff --git a/spool.c b/spool.c index d9d17e2..9a74620 100644 --- a/spool.c +++ b/spool.c @@ -308,7 +308,7 @@ aquirespool(struct qitem *it) int queuefd; if (it->queuef == NULL) { - queuefd = open_locked(it->queuefn, O_RDWR); + queuefd = open_locked(it->queuefn, O_RDWR|O_NONBLOCK); if (queuefd < 0) goto fail; it->queuef = fdopen(queuefd, "r+");