summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--bin/watch.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/bin/watch.c b/bin/watch.c
index f1b76baa..a18d9b36 100644
--- a/bin/watch.c
+++ b/bin/watch.c
@@ -26,7 +26,7 @@
 
 static void watch(int kq, char *path) {
     int fd = open(path, O_RDONLY);
-    if (fd < 0) err(EX_IOERR, "%s", path);
+    if (fd < 0) err(EX_NOINPUT, "%s", path);
 
     struct kevent event = {
         .ident = fd,
@@ -36,7 +36,7 @@ static void watch(int kq, char *path) {
         .udata = path,
     };
     int nevents = kevent(kq, &event, 1, NULL, 0, NULL);
-    if (nevents < 0) err(EX_IOERR, "kevent");
+    if (nevents < 0) err(EX_OSERR, "kevent");
 }
 
 static void exec(char *const argv[]) {
@@ -44,8 +44,8 @@ static void exec(char *const argv[]) {
     if (pid < 0) err(EX_OSERR, "fork");
 
     if (!pid) {
-        execvp(argv[0], argv);
-        err(EX_OSERR, "%s", argv[0]);
+        execvp(*argv, argv);
+        err(EX_NOINPUT, "%s", *argv);
     }
 
     int status;
@@ -67,27 +67,27 @@ int main(int argc, char *argv[]) {
     int kq = kqueue();
     if (kq < 0) err(EX_OSERR, "kqueue");
 
-    int index;
-    for (index = 1; index < argc - 1; ++index) {
-        if (argv[index][0] == '-') {
-            index++;
+    int i;
+    for (i = 1; i < argc - 1; ++i) {
+        if (argv[i][0] == '-') {
+            i++;
             break;
         }
-        watch(kq, argv[index]);
+        watch(kq, argv[i]);
     }
 
-    exec(&argv[index]);
+    exec(&argv[i]);
 
     for (;;) {
         struct kevent event;
         int nevents = kevent(kq, NULL, 0, &event, 1, NULL);
-        if (nevents < 0) err(EX_IOERR, "kevent");
+        if (nevents < 0) err(EX_OSERR, "kevent");
 
         if (event.fflags & NOTE_DELETE) {
             close(event.ident);
             watch(kq, event.udata);
         }
 
-        exec(&argv[index]);
+        exec(&argv[i]);
     }
 }
-09-15 16:02:27 -0400'>2024-09-15Add some more film stocks to the listJune McEnroe 2024-09-13Add photos from September 2June McEnroe 2024-09-13Add Fomapan 200 to films listJune McEnroe 2024-09-10Add August 29 picnic photosJune McEnroe 2024-09-08Apply some bold to trips renderingJune McEnroe This seems easier to visually scan. The only other thing I'd like is a nicer date rendering but JavaScript is useless for that. 2024-09-08Render trips hopefully more efficientlyJune McEnroe 2024-09-08Allow removing bodies and lensesJune McEnroe 2024-09-08Limit body width so it looks less silly on desktopJune McEnroe 2024-09-07Handle no film being loadedJune McEnroe 2024-09-07Fancy up the text a littleJune McEnroe