Skip to contentSkip to conversation

fswatch: Add fswatch API

PATCH In review Andrew Zaborowski 2 participants 3 messages Jul 20, 2018 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 fswatch: Add fswatch API

Add the header and the implementation for a filesystem watch API. It's a simple wrapper around the Linux inotify mechanism but not named inotify so as not to preclude using other mechanisms in the implementation.

---
 Makefile.am   |   6 +-
 ell/ell.h     |   1 +
 ell/fswatch.c | 255 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 ell/fswatch.h |  44 ++++++++++
 4 files changed, 304 insertions(+), 2 deletions(-)
 create mode 100644 ell/fswatch.c
 create mode 100644 ell/fswatch.h
Makefile.am +4 -2
index 100e24c..8203fd4 100644
@@ -45,7 +45,8 @@ pkginclude_HEADERS = ell/ell.h \
 			ell/pkcs5.h \
 			ell/file.h \
 			ell/net.h \
-			ell/dhcp.h
+			ell/dhcp.h \
+			ell/fswatch.h
 
 lib_LTLIBRARIES = ell/libell.la
 
@@ -104,7 +105,8 @@ ell_libell_la_SOURCES = $(linux_headers) \
 			ell/dhcp-private.h \
 			ell/dhcp.c \
 			ell/dhcp-transport.c \
-			ell/dhcp-lease.c
+			ell/dhcp-lease.c \
+			ell/fswatch.c
 
 ell_libell_la_LDFLAGS = -no-undefined \
 			-version-info $(ELL_CURRENT):$(ELL_REVISION):$(ELL_AGE)
ell/ell.h +1 -0
index 03bb61d..c03faf2 100644
@@ -53,3 +53,4 @@
 #include <ell/dbus-service.h>
 #include <ell/dbus-client.h>
 #include <ell/dhcp.h>
+#include <ell/fswatch.h>
ell/fswatch.c new file +255 -0

255 lines not on this page · raw message

ell/fswatch.h new file +44 -0

44 lines not on this page · raw message

Signature · 1 line
2.14.1
#1 lore raw

PATCH 2/2 unit: Add an fswatch unit test

---
 .gitignore          |   1 +
 Makefile.am         |   5 +-
 unit/test-fswatch.c | 293 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 298 insertions(+), 1 deletion(-)
 create mode 100644 unit/test-fswatch.c
.gitignore +1 -0
index 4dc3777..6c9ffb0 100644
@@ -55,6 +55,7 @@ unit/test-uuid
 unit/test-key
 unit/test-pbkdf2
 unit/test-dhcp
+unit/test-fswatch
 unit/cert-*.pem
 unit/cert-*.csr
 unit/cert-*.srl
Makefile.am +4 -1
index 8203fd4..9fe00fb 100644
@@ -147,7 +147,8 @@ unit_tests = unit/test-unit \
 			unit/test-base64 \
 			unit/test-uuid \
 			unit/test-pbkdf2 \
-			unit/test-dhcp
+			unit/test-dhcp \
+			unit/test-fswatch
 
 dbus_tests = unit/test-hwdb \
 			unit/test-dbus \
@@ -264,6 +265,8 @@ unit_test_uuid_LDADD = ell/libell-private.la
 
 unit_test_dhcp_LDADD = ell/libell-private.la
 
+unit_test_fswatch_LDADD = ell/libell-private.la
+
 if MAINTAINER_MODE
 noinst_LTLIBRARIES += unit/example-plugin.la
 endif
unit/test-fswatch.c new file +293 -0

293 lines not on this page · raw message

Signature · 1 line
2.14.1
#2 lore raw
In reply to Andrew Zaborowski

Hi Andrew,

Quoted 12 lines · Andrew Zaborowski

Add the header and the implementation for a filesystem watch API. It's a simple wrapper around the Linux inotify mechanism but not named inotify so as not to preclude using other mechanisms in the implementation.

---
  Makefile.am   |   6 +-
  ell/ell.h     |   1 +
  ell/fswatch.c | 255 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  ell/fswatch.h |  44 ++++++++++
  4 files changed, 304 insertions(+), 2 deletions(-)

create mode 100644 ell/fswatch.c
create mode 100644 ell/fswatch.h

Both applied, thanks.

Regards,
-Denis