]> err.no Git - systemd/commitdiff
return proper error code in rename_netif()
authorKay Sievers <kay.sievers@vrfy.org>
Mon, 18 Oct 2010 10:50:20 +0000 (12:50 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Mon, 18 Oct 2010 10:55:06 +0000 (12:55 +0200)
<Md>  kay: can you look at rename_netif()? it returns -errno in a place,
      but I think that it may by changed by err() (at least)
<kay> Md: yeah, that doesn't look correct

udev/udev-event.c

index ae523f83c5727249c6b7afae7c018780a698cb52..064873531b79d3f5a735ac52ec64868cecdb631d 100644 (file)
@@ -472,8 +472,9 @@ static int rename_netif(struct udev_event *event)
 
        sk = socket(PF_INET, SOCK_DGRAM, 0);
        if (sk < 0) {
+               err = -errno;
                err(event->udev, "error opening socket: %m\n");
-               return -errno;
+               return err;
        }
 
        memset(&ifr, 0x00, sizeof(struct ifreq));