diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2009-04-23 13:23:45 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2009-04-23 13:23:45 +0200 |
commit | 8c3ae78546a535cc9288a190680fb1eb88c6ea7e (patch) | |
tree | 24a2b7a42621d65f1f4923f984a0b38736c1d024 /udev | |
parent | 08a7a795f61eaf42f31b26e435067a664f0a4d4d (diff) |
libudev: queue - fix get_seqnum_is_finished()
On Thu, Apr 23, 2009 at 11:39, Alan Jenkins <alan-jenkins@tuffmail.co.uk> wrote:
> I'm puzzled by this function:
>
> /* if we have not seen this seqnum, check if it is/was already queued */
> if (seqnum < udev_queue->last_seen_udev_seqnum) {
> udev_queue_get_udev_seqnum(udev_queue);
> if (seqnum < udev_queue->last_seen_udev_seqnum)
>
> Shouldn't the test be (seqnum > udev_queue->last_seen_udev_seqnum) ?
Diffstat (limited to 'udev')
-rw-r--r-- | udev/lib/libudev-queue.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/udev/lib/libudev-queue.c b/udev/lib/libudev-queue.c index a0f4c5575c..7550d96370 100644 --- a/udev/lib/libudev-queue.c +++ b/udev/lib/libudev-queue.c @@ -179,11 +179,10 @@ int udev_queue_get_seqnum_is_finished(struct udev_queue *udev_queue, unsigned lo if (udev_queue == NULL) return -EINVAL; /* if we have not seen this seqnum, check if it is/was already queued */ - if (seqnum < udev_queue->last_seen_udev_seqnum) { - udev_queue_get_udev_seqnum(udev_queue); - if (seqnum < udev_queue->last_seen_udev_seqnum) + if (seqnum > udev_queue->last_seen_udev_seqnum) + if (seqnum > udev_queue_get_udev_seqnum(udev_queue)) return 0; - } + snprintf(filename, sizeof(filename), "%s/.udev/queue/%llu", udev_get_dev_path(udev_queue->udev), seqnum); if (lstat(filename, &statbuf) == 0) |