diff options
author | Tom Gundersen <teg@jklm.no> | 2014-04-29 22:27:29 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-04-30 00:05:28 +0200 |
commit | 7e141e498c73ec7c8b61a0df37c4937f1d6becc7 (patch) | |
tree | 7710684079476b544e5205316a8e0fbb0a926b09 /src/network | |
parent | ba9f11dc98f6812a3333411453ff6fb324abf303 (diff) |
sd-network: add support for only listening to some types of changes
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/sd-network.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/network/sd-network.c b/src/network/sd-network.c index 3b541a2764..1dfb282a0a 100644 --- a/src/network/sd-network.c +++ b/src/network/sd-network.c @@ -166,7 +166,7 @@ _public_ int sd_network_monitor_new(const char *category, sd_network_monitor **m if (fd < 0) return -errno; - if (!category || streq(category, "netif")) { + if (!category || streq(category, "links")) { k = inotify_add_watch(fd, "/run/systemd/network/links/", IN_MOVED_TO|IN_DELETE); if (k < 0) { safe_close(fd); @@ -176,6 +176,16 @@ _public_ int sd_network_monitor_new(const char *category, sd_network_monitor **m good = true; } + if (!category || streq(category, "leases")) { + k = inotify_add_watch(fd, "/run/systemd/network/leases/", IN_MOVED_TO|IN_DELETE); + if (k < 0) { + safe_close(fd); + return -errno; + } + + good = true; + } + if (!good) { close_nointr(fd); return -EINVAL; |