summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--bin/watch.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/bin/watch.c b/bin/watch.c
index 3308edc9..08a4ae9e 100644
--- a/bin/watch.c
+++ b/bin/watch.c
@@ -28,13 +28,16 @@ static void watch(int kq, char *path) {
 	int fd = open(path, O_CLOEXEC);
 	if (fd < 0) err(EX_NOINPUT, "%s", path);
 
-	struct kevent event = {
-		.ident = fd,
-		.filter = EVFILT_VNODE,
-		.flags = EV_ADD | EV_CLEAR,
-		.fflags = NOTE_WRITE | NOTE_DELETE,
-		.udata = path,
-	};
+	struct kevent event;
+	EV_SET(
+		&event,
+		fd,
+		EVFILT_VNODE,
+		EV_ADD | EV_CLEAR,
+		NOTE_WRITE | NOTE_DELETE,
+		0,
+		path
+	);
 	int nevents = kevent(kq, &event, 1, NULL, 0, NULL);
 	if (nevents < 0) err(EX_OSERR, "kevent");
 }
@@ -86,7 +89,7 @@ int main(int argc, char *argv[]) {
 		if (event.fflags & NOTE_DELETE) {
 			close(event.ident);
 			sleep(1);
-			watch(kq, event.udata);
+			watch(kq, (char *)event.udata);
 		}
 
 		exec(&argv[i]);
-25/lens?id=cf3163745dccf37925e54b84aaf38685c717186a&follow=1'>Add photos from June 25-30June McEnroe 2024-06-30Add photos from June 22 (and the few days after that)June McEnroe 2024-06-30Accommodate lower-case .jpg filesJune McEnroe 2024-06-23Add another BACKXWASH showJune McEnroe 2024-06-16Update bioJune McEnroe 2024-06-15Add photo descriptions from June 12June McEnroe 2024-06-10Add first roll of film from June 8June McEnroe 2024-06-10Cope with not having an EXIF infoJune McEnroe 2024-06-10Resize using target pixel counts for consistencyJune McEnroe 2024-06-10Add The Girl Who Was Convinced...June McEnroe 2024-06-09Add photos from May 31June McEnroe 2024-06-09Use monospace on photo pagesJune McEnroe 2024-06-09Put lens and (future) film at the tops of photo pagesJune McEnroe 2024-05-22Remove use of sysexits.hJune McEnroe 2024-05-22Add photo descriptions from 05-03 and 05-06June McEnroe 2024-05-21Fix = precedence in whenJune McEnroe