chiark / gitweb /
use CLOEXEC flags instead of fcntl()
[elogind.git] / libudev / libudev-queue.c
index 691e6a7919ec397242a9b73be1198a0b4a29d076..f06c9e8a7a3caaeced9653bc7678f50a2adb0fa5 100644 (file)
@@ -28,7 +28,7 @@
  * SECTION:libudev-queue
  * @short_description: access to currently active events
  *
- * The udev daemon processes event asynchronously. All events wich do not have
+ * The udev daemon processes event asynchronously. All events which do not have
  * interdependencies are run in parallel. This exports the current state of the
  * event processing queue, and the currently event sequence numbers from the kernel
  * and the udev daemon.
@@ -360,10 +360,14 @@ int udev_queue_get_seqnum_sequence_is_finished(struct udev_queue *udev_queue,
                return 1;
        if (start < seqnum)
                start = seqnum;
-       if (start > end)
+       if (start > end) {
+               fclose(queue_file);
                return 1;
-       if (end - start > INT_MAX - 1)
+       }
+       if (end - start > INT_MAX - 1) {
+               fclose(queue_file);
                return -EOVERFLOW;
+       }
        unfinished = (end - start) + 1;
 
        while (unfinished > 0) {