chiark / gitweb /
udev: switch to systemd logging functions
[elogind.git] / src / udev / udev-watch.c
index 228d18fedf4935707abaa20f11c558004f2dfca7..968728eba9e84c6ddd317daec506a3d7008fb802 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004-2010 Kay Sievers <kay.sievers@vrfy.org>
+ * Copyright (C) 2004-2012 Kay Sievers <kay.sievers@vrfy.org>
  * Copyright (C) 2009 Canonical Ltd.
  * Copyright (C) 2009 Scott James Remnant <scott@netsplit.com>
  *
@@ -40,7 +40,7 @@ int udev_watch_init(struct udev *udev)
 {
         inotify_fd = inotify_init1(IN_CLOEXEC);
         if (inotify_fd < 0)
-                err(udev, "inotify_init failed: %m\n");
+                log_error("inotify_init failed: %m\n");
         return inotify_fd;
 }
 
@@ -62,7 +62,7 @@ void udev_watch_restore(struct udev *udev)
 
                 dir = opendir(oldname);
                 if (dir == NULL) {
-                        err(udev, "unable to open old watches dir '%s', old watches will not be restored: %m", oldname);
+                        log_error("unable to open old watches dir '%s', old watches will not be restored: %m", oldname);
                         return;
                 }
 
@@ -87,7 +87,7 @@ void udev_watch_restore(struct udev *udev)
                         if (dev == NULL)
                                 goto unlink;
 
-                        info(udev, "restoring old watch on '%s'\n", udev_device_get_devnode(dev));
+                        log_debug("restoring old watch on '%s'\n", udev_device_get_devnode(dev));
                         udev_watch_begin(udev, dev);
                         udev_device_unref(dev);
 unlink:
@@ -98,7 +98,7 @@ unlink:
                 rmdir(oldname);
 
         } else if (errno != ENOENT) {
-                err(udev, "unable to move watches dir '%s', old watches will not be restored: %m", filename);
+                log_error("unable to move watches dir '%s', old watches will not be restored: %m", filename);
         }
 }
 
@@ -110,10 +110,10 @@ void udev_watch_begin(struct udev *udev, struct udev_device *dev)
         if (inotify_fd < 0)
                 return;
 
-        info(udev, "adding watch on '%s'\n", udev_device_get_devnode(dev));
+        log_debug("adding watch on '%s'\n", udev_device_get_devnode(dev));
         wd = inotify_add_watch(inotify_fd, udev_device_get_devnode(dev), IN_CLOSE_WRITE);
         if (wd < 0) {
-                err(udev, "inotify_add_watch(%d, %s, %o) failed: %m\n",
+                log_error("inotify_add_watch(%d, %s, %o) failed: %m\n",
                     inotify_fd, udev_device_get_devnode(dev), IN_CLOSE_WRITE);
                 return;
         }
@@ -138,7 +138,7 @@ void udev_watch_end(struct udev *udev, struct udev_device *dev)
         if (wd < 0)
                 return;
 
-        info(udev, "removing watch on '%s'\n", udev_device_get_devnode(dev));
+        log_debug("removing watch on '%s'\n", udev_device_get_devnode(dev));
         inotify_rm_watch(inotify_fd, wd);
 
         snprintf(filename, sizeof(filename), "%s/watch/%d", udev_get_run_path(udev), wd);