diff options
author | Alan Jenkins <alan-jenkins@tuffmail.co.uk> | 2008-09-29 16:01:32 +0100 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2008-09-29 17:06:00 +0200 |
commit | 659353f5a9a52336c41cf595d933311b8dc48937 (patch) | |
tree | 1a12cc4fd2ec90db52a0f586e08a2f49a6ca8306 /udev/udevadm-trigger.c | |
parent | 5c0f595d91a21b1fba2b9edd89511a072036d0e8 (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/udevadm-trigger.c')
-rw-r--r-- | udev/udevadm-trigger.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/udev/udevadm-trigger.c b/udev/udevadm-trigger.c index e7940ef92d..a0f10dac68 100644 --- a/udev/udevadm-trigger.c +++ b/udev/udevadm-trigger.c @@ -105,12 +105,12 @@ static void trigger_uevent(struct udev *udev, const char *syspath, const char *a fd = open(filename, O_WRONLY); if (fd < 0) { - dbg(udev, "error on opening %s: %s\n", filename, strerror(errno)); + dbg(udev, "error on opening %s: %m\n", filename); return; } if (write(fd, action, strlen(action)) < 0) - info(udev, "error writing '%s' to '%s': %s\n", action, filename, strerror(errno)); + info(udev, "error writing '%s' to '%s': %m\n", action, filename); close(fd); } |