]> gitweb.michael.orlitzky.com - apply-default-acl.git/blobdiff - src/libadacl.c
libadacl: add error checking when we open() the filesystem root.
[apply-default-acl.git] / src / libadacl.c
index d4e99aa2e48106ab51c806afc719f7890d2240c9..21b8141cbbc0158a3c6cfce3e985838bed1e20ce 100644 (file)
@@ -160,6 +160,11 @@ int safe_open(const char* pathname, int flags) {
   }
 
   int fd = open("/", flags);
+  if (fd == OPEN_ERROR) {
+    perror("safe_open (open)");
+    return OPEN_ERROR;
+  }
+
   if (strcmp(abspath, "/") == 0) {
     return fd;
   }