summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <programble@gmail.com>2018-02-23 13:47:51 -0500
committerJune McEnroe <programble@gmail.com>2018-02-23 13:47:51 -0500
commitd859f28b5bcdb4be674200e943b21a3e8a704724 (patch)
tree1c1c7f23b53f47dee24034ca7b2604a9b391fc74
parentRewrite bri (diff)
downloadsrc-d859f28b5bcdb4be674200e943b21a3e8a704724.tar.gz
src-d859f28b5bcdb4be674200e943b21a3e8a704724.zip
Return EX_OSFILE in bri
Diffstat (limited to '')
-rw-r--r--bin/bri.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/bri.c b/bin/bri.c
index 1cb62afd..c3ec723c 100644
--- a/bin/bri.c
+++ b/bin/bri.c
@@ -34,14 +34,14 @@ int main(int argc, char *argv[]) {
     if (error) err(EX_OSFILE, "%s", CLASS);
 
     DIR *dir = opendir(".");
-    if (!dir) err(EX_NOPERM, "%s", CLASS);
+    if (!dir) err(EX_OSFILE, "%s", CLASS);
 
     struct dirent *entry;
     while (NULL != (errno = 0, entry = readdir(dir))) {
         if (entry->d_name[0] == '.') continue;
 
         error = chdir(entry->d_name);
-        if (error) err(EX_NOPERM, "%s/%s", CLASS, entry->d_name);
+        if (error) err(EX_OSFILE, "%s/%s", CLASS, entry->d_name);
         break;
     }
     if (!entry) {
@@ -50,7 +50,7 @@ int main(int argc, char *argv[]) {
     }
 
     FILE *actual = fopen("actual_brightness", "r");
-    if (!actual) err(EX_NOPERM, "%s/actual_brightness", CLASS);
+    if (!actual) err(EX_OSFILE, "%s/actual_brightness", CLASS);
 
     unsigned value;
     int match = fscanf(actual, "%u", &value);
@@ -74,7 +74,7 @@ int main(int argc, char *argv[]) {
     }
 
     FILE *brightness = fopen("brightness", "w");
-    if (!brightness) err(EX_NOPERM, "%s/brightness", CLASS);
+    if (!brightness) err(EX_OSFILE, "%s/brightness", CLASS);
 
     int size = fprintf(brightness, "%u", value);
     if (size < 0) err(EX_IOERR, "brightness");