mirror of
https://github.com/troglobit/finit.git
synced 2026-10-11 17:02:42 +07:00
New API, iwatch_add1() with no preset mask
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
+7
-2
@@ -87,7 +87,7 @@ void iwatch_exit(struct iwatch *iw)
|
||||
initialized = 0;
|
||||
}
|
||||
|
||||
int iwatch_add(struct iwatch *iw, char *file, uint32_t mask)
|
||||
int iwatch_add1(struct iwatch *iw, char *file, uint32_t mask)
|
||||
{
|
||||
struct iwatch_path *iwp;
|
||||
char *path;
|
||||
@@ -108,7 +108,7 @@ int iwatch_add(struct iwatch *iw, char *file, uint32_t mask)
|
||||
return -1;
|
||||
}
|
||||
|
||||
wd = inotify_add_watch(iw->fd, path, IWATCH_MASK | mask);
|
||||
wd = inotify_add_watch(iw->fd, path, mask);
|
||||
if (wd < 0) {
|
||||
switch (errno) {
|
||||
case EEXIST:
|
||||
@@ -147,6 +147,11 @@ int iwatch_add(struct iwatch *iw, char *file, uint32_t mask)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int iwatch_add(struct iwatch *iw, char *file, uint32_t mask)
|
||||
{
|
||||
return iwatch_add1(iw, file, IWATCH_MASK | mask);
|
||||
}
|
||||
|
||||
int iwatch_del(struct iwatch *iw, struct iwatch_path *iwp)
|
||||
{
|
||||
if (!initialized)
|
||||
|
||||
@@ -59,6 +59,7 @@ struct iwatch {
|
||||
int iwatch_init (struct iwatch *iw);
|
||||
void iwatch_exit (struct iwatch *iw);
|
||||
|
||||
int iwatch_add1 (struct iwatch *iw, char *file, uint32_t mask);
|
||||
int iwatch_add (struct iwatch *iw, char *file, uint32_t mask);
|
||||
int iwatch_del (struct iwatch *iw, struct iwatch_path *iwp);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user