[systemd-devel] Reorder usage of streq_ptr, don't think it was correct in the first place

Lennart Poettering lennart at poettering.net
Fri Jun 13 02:49:52 PDT 2014


On Fri, 13.06.14 10:49, Robert Milasan (rmilasan at suse.com) wrote:

> It seems that in udevd.c synthesize_change that order of arguments in
> streq_ptr is wrong, or at least it looks wrong to me.
> 
> I've attached the patch which should fix the issue.

Hmm? Not following? streq_ptr() compares two strings, why would the order matter
for that?

> >From 67f470fbc1711e8199e71c30a51de5033db7b596 Mon Sep 17 00:00:00 2001
> From: Robert Milasan <rmilasan at suse.com>
> Date: Fri, 13 Jun 2014 10:46:37 +0200
> Subject: [PATCH] udevd: really check for partitions in synthesize_change
> 
> Signed-off-by: Robert Milasan <rmilasan at suse.com>
> ---
>  src/udev/udevd.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/udev/udevd.c b/src/udev/udevd.c
> index a45d324..aed1149 100644
> --- a/src/udev/udevd.c
> +++ b/src/udev/udevd.c
> @@ -790,7 +790,7 @@ static int synthesize_change(struct udev_device *dev) {
>                          if (!d)
>                                  continue;
>  
> -                        if (!streq_ptr("partition", udev_device_get_devtype(d)))
> +                        if (!streq_ptr(udev_device_get_devtype(d), "partition"))
>                                  continue;
>  
>                          has_partitions = true;
> @@ -820,7 +820,7 @@ static int synthesize_change(struct udev_device *dev) {
>                          if (!d)
>                                  continue;
>  
> -                        if (!streq_ptr("partition", udev_device_get_devtype(d)))
> +                        if (!streq_ptr(udev_device_get_devtype(d), "partition"))
>                                  continue;
>  
>                          log_debug("device %s closed, synthesising partition '%s' 'change'",

> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel



Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list