summaryrefslogtreecommitdiff
path: root/udev/udev_device_event.c
diff options
context:
space:
mode:
authorAlan Jenkins <alan-jenkins@tuffmail.co.uk>2008-09-29 16:01:32 +0100
committerKay Sievers <kay.sievers@vrfy.org>2008-09-29 17:06:00 +0200
commit659353f5a9a52336c41cf595d933311b8dc48937 (patch)
tree1a12cc4fd2ec90db52a0f586e08a2f49a6ca8306 /udev/udev_device_event.c
parent5c0f595d91a21b1fba2b9edd89511a072036d0e8 (diff)
replace strerror() usage with threadsafe "%m" format string
strerror() is not threadsafe. It uses a buffer to build messages of the form "Unknown error 387689". syslog() provides a %m format which is equivalent to strerror(errno). As a GNU extension, this is also accepted by printf and friends. At least in the current implementation, it is correctly threadsafe. Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Diffstat (limited to 'udev/udev_device_event.c')
-rw-r--r--udev/udev_device_event.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/udev/udev_device_event.c b/udev/udev_device_event.c
index aacd1d2bc1..4408400ff8 100644
--- a/udev/udev_device_event.c
+++ b/udev/udev_device_event.c
@@ -63,7 +63,7 @@ static int rename_netif(struct udevice *udevice)
sk = socket(PF_INET, SOCK_DGRAM, 0);
if (sk < 0) {
- err(udevice->udev, "error opening socket: %s\n", strerror(errno));
+ err(udevice->udev, "error opening socket: %m\n");
return -1;
}
@@ -78,8 +78,8 @@ static int rename_netif(struct udevice *udevice)
/* see if the destination interface name already exists */
if (errno != EEXIST) {
- err(udevice->udev, "error changing netif name %s to %s: %s\n",
- ifr.ifr_name, ifr.ifr_newname, strerror(errno));
+ err(udevice->udev, "error changing netif name %s to %s: %m\n",
+ ifr.ifr_name, ifr.ifr_newname);
goto exit;
}
@@ -88,8 +88,8 @@ static int rename_netif(struct udevice *udevice)
util_strlcat(ifr.ifr_newname, "_rename", IFNAMSIZ);
retval = ioctl(sk, SIOCSIFNAME, &ifr);
if (retval != 0) {
- err(udevice->udev, "error changing netif name %s to %s: %s\n",
- ifr.ifr_name, ifr.ifr_newname, strerror(errno));
+ err(udevice->udev, "error changing netif name %s to %s: %m\n",
+ ifr.ifr_name, ifr.ifr_newname);
goto exit;
}
@@ -105,8 +105,8 @@ static int rename_netif(struct udevice *udevice)
}
if (errno != EEXIST) {
- err(udevice->udev, "error changing net interface name %s to %s: %s\n",
- ifr.ifr_name, ifr.ifr_newname, strerror(errno));
+ err(udevice->udev, "error changing net interface name %s to %s: %m\n",
+ ifr.ifr_name, ifr.ifr_newname);
break;
}
dbg(udevice->udev, "wait for netif '%s' to become free, loop=%i\n",