summaryrefslogtreecommitdiff
path: root/src/libudev/libudev-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-02-13 14:45:51 +0100
committerLennart Poettering <lennart@poettering.net>2014-02-13 14:45:51 +0100
commit955d98c9c1104d469c2989dbfb58f58ee6fe9bdc (patch)
tree6964487e69bfefbbb08b0de140c67c6f2a00d791 /src/libudev/libudev-util.c
parent7e2270246b0906675c8f34bc278b1608b969e65c (diff)
everywhere: make use of new0() and macro() macros, and stop using perror()
Diffstat (limited to 'src/libudev/libudev-util.c')
-rw-r--r--src/libudev/libudev-util.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libudev/libudev-util.c b/src/libudev/libudev-util.c
index c940e06f71..d9cdde1751 100644
--- a/src/libudev/libudev-util.c
+++ b/src/libudev/libudev-util.c
@@ -203,6 +203,7 @@ int util_resolve_subsys_kernel(struct udev *udev, const char *string,
udev_device_unref(dev);
return 0;
}
+
ssize_t util_get_sys_core_link_value(struct udev *udev, const char *slink, const char *syspath, char *value, size_t size)
{
char path[UTIL_PATH_SIZE];
@@ -417,7 +418,7 @@ uint64_t util_string_bloom64(const char *str)
ssize_t print_kmsg(const char *fmt, ...)
{
- int fd;
+ _cleanup_close_ int fd = -1;
va_list ap;
char text[1024];
ssize_t len;
@@ -435,7 +436,7 @@ ssize_t print_kmsg(const char *fmt, ...)
ret = write(fd, text, len);
if (ret < 0)
- ret = -errno;
- close(fd);
+ return -errno;
+
return ret;
}