Use new log macros also in keventd and iwatch.c

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2022-09-25 05:49:39 +02:00
parent a3584c6ca3
commit 34567dd244
2 changed files with 9 additions and 9 deletions
+8 -8
View File
@@ -52,7 +52,7 @@ int iwatch_init(struct iwatch *iw)
iw->fd = inotify_init1(IN_NONBLOCK | IN_CLOEXEC);
if (iw->fd < 0) {
_pe("Failed creating inotify descriptor");
warn("Failed creating inotify descriptor");
return -1;
}
@@ -64,7 +64,7 @@ int iwatch_init(struct iwatch *iw)
len = sizeof(sz);
if (!getsockopt(iw->fd, SOL_SOCKET, SO_RCVBUF, &sz, &len)) {
if (setsockopt(iw->fd, SOL_SOCKET, SO_RCVBUF, &sz, sizeof(sz)))
_pe("Failed increasing size of inotify socket");
warn("Failed increasing size of inotify socket");
}
initialized = 1;
@@ -97,14 +97,14 @@ int iwatch_add(struct iwatch *iw, char *file, uint32_t mask)
return -1;
if (!fexist(file)) {
_d("skipping %s: no such file or directory", file);
dbg("skipping %s: no such file or directory", file);
return 0;
}
_d("adding new watcher for path %s", file);
dbg("adding new watcher for path %s", file);
path = strdup(file);
if (!path) {
_pe("Out of memory");
warn("Out of memory");
return -1;
}
@@ -124,7 +124,7 @@ int iwatch_add(struct iwatch *iw, char *file, uint32_t mask)
/* fallthrough */
default:
_pe("Failed adding watcher for %s", path);
warn("Failed adding watcher for %s", path);
break;
}
@@ -134,7 +134,7 @@ int iwatch_add(struct iwatch *iw, char *file, uint32_t mask)
iwp = malloc(sizeof(struct iwatch_path));
if (!iwp) {
_pe("Failed allocating new `struct iwatch_path`");
warn("Failed allocating new `struct iwatch_path`");
inotify_rm_watch(iw->fd, wd);
free(path);
return -1;
@@ -152,7 +152,7 @@ int iwatch_del(struct iwatch *iw, struct iwatch_path *iwp)
if (!initialized)
return -1;
_d("Removing watcher for removed path %s", iwp->path);
dbg("Removing watcher for removed path %s", iwp->path);
TAILQ_REMOVE(&iw->iwp_list, iwp, link);
inotify_rm_watch(iw->fd, iwp->wd);
+1 -1
View File
@@ -152,7 +152,7 @@ static void init(void)
for (i = 0; i < (int)NELEMS(cond_dirs); i++) {
if (mkpath(cond_dirs[i], 0755) && errno != EEXIST) {
_pe("Failed creating %s condition directory, %s", COND_SYS,
warn("Failed creating %s condition directory, %s", COND_SYS,
cond_dirs[i]);
return;
}