mirror of
https://github.com/troglobit/finit.git
synced 2026-11-01 13:10:32 +00:00
Use new log macros also in keventd and iwatch.c
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
a3584c6ca3
commit
34567dd244
2 files changed
+9
-9
No files matched your search
+8
-8
@@ -52,7 +52,7 @@ int iwatch_init(struct iwatch *iw)
|
|||||||
|
|
||||||
iw->fd = inotify_init1(IN_NONBLOCK | IN_CLOEXEC);
|
iw->fd = inotify_init1(IN_NONBLOCK | IN_CLOEXEC);
|
||||||
if (iw->fd < 0) {
|
if (iw->fd < 0) {
|
||||||
_pe("Failed creating inotify descriptor");
|
warn("Failed creating inotify descriptor");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ int iwatch_init(struct iwatch *iw)
|
|||||||
len = sizeof(sz);
|
len = sizeof(sz);
|
||||||
if (!getsockopt(iw->fd, SOL_SOCKET, SO_RCVBUF, &sz, &len)) {
|
if (!getsockopt(iw->fd, SOL_SOCKET, SO_RCVBUF, &sz, &len)) {
|
||||||
if (setsockopt(iw->fd, SOL_SOCKET, SO_RCVBUF, &sz, sizeof(sz)))
|
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;
|
initialized = 1;
|
||||||
@@ -97,14 +97,14 @@ int iwatch_add(struct iwatch *iw, char *file, uint32_t mask)
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!fexist(file)) {
|
if (!fexist(file)) {
|
||||||
_d("skipping %s: no such file or directory", file);
|
dbg("skipping %s: no such file or directory", file);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
_d("adding new watcher for path %s", file);
|
dbg("adding new watcher for path %s", file);
|
||||||
|
|
||||||
path = strdup(file);
|
path = strdup(file);
|
||||||
if (!path) {
|
if (!path) {
|
||||||
_pe("Out of memory");
|
warn("Out of memory");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ int iwatch_add(struct iwatch *iw, char *file, uint32_t mask)
|
|||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
|
|
||||||
default:
|
default:
|
||||||
_pe("Failed adding watcher for %s", path);
|
warn("Failed adding watcher for %s", path);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ int iwatch_add(struct iwatch *iw, char *file, uint32_t mask)
|
|||||||
|
|
||||||
iwp = malloc(sizeof(struct iwatch_path));
|
iwp = malloc(sizeof(struct iwatch_path));
|
||||||
if (!iwp) {
|
if (!iwp) {
|
||||||
_pe("Failed allocating new `struct iwatch_path`");
|
warn("Failed allocating new `struct iwatch_path`");
|
||||||
inotify_rm_watch(iw->fd, wd);
|
inotify_rm_watch(iw->fd, wd);
|
||||||
free(path);
|
free(path);
|
||||||
return -1;
|
return -1;
|
||||||
@@ -152,7 +152,7 @@ int iwatch_del(struct iwatch *iw, struct iwatch_path *iwp)
|
|||||||
if (!initialized)
|
if (!initialized)
|
||||||
return -1;
|
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);
|
TAILQ_REMOVE(&iw->iwp_list, iwp, link);
|
||||||
inotify_rm_watch(iw->fd, iwp->wd);
|
inotify_rm_watch(iw->fd, iwp->wd);
|
||||||
|
|||||||
+1
-1
@@ -152,7 +152,7 @@ static void init(void)
|
|||||||
|
|
||||||
for (i = 0; i < (int)NELEMS(cond_dirs); i++) {
|
for (i = 0; i < (int)NELEMS(cond_dirs); i++) {
|
||||||
if (mkpath(cond_dirs[i], 0755) && errno != EEXIST) {
|
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]);
|
cond_dirs[i]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user