summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-09-10 21:22:46 -0400
committerAnthony G. Basile <blueness@gentoo.org>2014-09-10 21:22:46 -0400
commit89f2848567ec16e019db4309cef0ebcd9a6c5196 (patch)
treec594d9a9f06a987391ccb95e85b52737dbcb6ad9
parent876565e4f64224574e7be2644dc3600aaa1b9b55 (diff)
udev - drop print_kmsg
The only remaining user was 'starting version XXX', which is now logged using log_info(). Basile: There were also print_kmsg in udev-event.c which I switched to log_info(). Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
-rw-r--r--src/libudev/libudev-private.h1
-rw-r--r--src/libudev/libudev-util.c25
-rw-r--r--src/udev/udev-event.c6
-rw-r--r--src/udev/udevd.c2
4 files changed, 4 insertions, 30 deletions
diff --git a/src/libudev/libudev-private.h b/src/libudev/libudev-private.h
index c1b631b13f..2ad74c0d9c 100644
--- a/src/libudev/libudev-private.h
+++ b/src/libudev/libudev-private.h
@@ -171,6 +171,5 @@ int util_delete_path(struct udev *udev, const char *path);
uid_t util_lookup_user(struct udev *udev, const char *user);
gid_t util_lookup_group(struct udev *udev, const char *group);
int util_resolve_subsys_kernel(struct udev *udev, const char *string, char *result, size_t maxsize, int read_value);
-ssize_t print_kmsg(const char *fmt, ...) _printf_(1, 2);
#endif
diff --git a/src/libudev/libudev-util.c b/src/libudev/libudev-util.c
index 531c76c6a3..61eeb4e4d7 100644
--- a/src/libudev/libudev-util.c
+++ b/src/libudev/libudev-util.c
@@ -423,28 +423,3 @@ uint64_t util_string_bloom64(const char *str)
bits |= 1LLU << ((hash >> 18) & 63);
return bits;
}
-
-ssize_t print_kmsg(const char *fmt, ...)
-{
- _cleanup_close_ int fd = -1;
- va_list ap;
- char text[1024];
- ssize_t len;
- ssize_t ret;
-
- fd = open("/dev/kmsg", O_WRONLY|O_NOCTTY|O_CLOEXEC);
- if (fd < 0)
- return -errno;
-
- len = snprintf(text, sizeof(text), "<30>udevd[%u]: ", getpid());
-
- va_start(ap, fmt);
- len += vsnprintf(text + len, sizeof(text) - len, fmt, ap);
- va_end(ap);
-
- ret = write(fd, text, len);
- if (ret < 0)
- return -errno;
-
- return ret;
-}
diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c
index 818448a573..3b12350d4a 100644
--- a/src/udev/udev-event.c
+++ b/src/udev/udev-event.c
@@ -782,7 +782,7 @@ static int rename_netif_dev_fromname_toname(struct udev_device *dev,const char *
int loop;
if (err == 0) {
- print_kmsg("renamed network interface %s to %s\n", ifr.ifr_name, ifr.ifr_newname);
+ log_info("renamed network interface %s to %s\n", ifr.ifr_name, ifr.ifr_newname);
goto out;
}
/* keep trying if the destination interface name already exists */
@@ -802,7 +802,7 @@ static int rename_netif_dev_fromname_toname(struct udev_device *dev,const char *
err = ioctl(sk, SIOCSIFNAME, &ifr);
if (err == 0) {
- print_kmsg("renamed network interface %s to %s\n", ifr.ifr_name, ifr.ifr_newname);
+ log_info("renamed network interface %s to %s\n", ifr.ifr_name, ifr.ifr_newname);
break;
}
err = -errno;
@@ -815,7 +815,7 @@ out:
log_error("error changing net interface name %s to %s: %m\n", ifr.ifr_name, ifr.ifr_newname);
#else
if (err >= 0) {
- print_kmsg("renamed network interface %s to %s\n", ifr.ifr_name, ifr.ifr_newname);
+ log_info("renamed network interface %s to %s\n", ifr.ifr_name, ifr.ifr_newname);
} else {
err = -errno;
log_error("error changing net interface name %s to %s: %m\n", ifr.ifr_name, ifr.ifr_newname);
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index a8ec498761..142c0d09da 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -1220,7 +1220,7 @@ int main(int argc, char *argv[]) {
write_string_file("/proc/self/oom_score_adj", "-1000");
}
- print_kmsg("starting version " VERSION "\n");
+ log_info("starting version " VERSION "\n");
if (!debug) {
int fd;