chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
udev: move libudev, gudev to src/; move gudev/docs/, udev/docs/ to to docs/
[elogind.git]
/
src
/
udev
/
udev-watch.c
diff --git
a/src/udev/udev-watch.c
b/src/udev/udev-watch.c
index 228d18fedf4935707abaa20f11c558004f2dfca7..968728eba9e84c6ddd317daec506a3d7008fb802 100644
(file)
--- a/
src/udev/udev-watch.c
+++ b/
src/udev/udev-watch.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 2004-201
0
Kay Sievers <kay.sievers@vrfy.org>
+ * Copyright (C) 2004-201
2
Kay Sievers <kay.sievers@vrfy.org>
* Copyright (C) 2009 Canonical Ltd.
* Copyright (C) 2009 Scott James Remnant <scott@netsplit.com>
*
* 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)
{
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;
}
return inotify_fd;
}
@@
-62,7
+62,7
@@
void udev_watch_restore(struct udev *udev)
dir = opendir(oldname);
if (dir == NULL) {
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;
}
return;
}
@@
-87,7
+87,7
@@
void udev_watch_restore(struct udev *udev)
if (dev == NULL)
goto unlink;
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:
udev_watch_begin(udev, dev);
udev_device_unref(dev);
unlink:
@@
-98,7
+98,7
@@
unlink:
rmdir(oldname);
} else if (errno != ENOENT) {
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;
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) {
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;
}
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;
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);
inotify_rm_watch(inotify_fd, wd);
snprintf(filename, sizeof(filename), "%s/watch/%d", udev_get_run_path(udev), wd);