* open a file descriptor in a symlink-safe way when combined with
* the @c O_NOFOLLOW flag.
*
+ * The @c O_PATH flag is not used because we want to fail upon
+ * encountering any symlinks.
+ *
* @param at_fd
* A file descriptor relative to which @c pathname will be opened.
*
}
int fd = open("/", flags);
+ if (fd == OPEN_ERROR) {
+ perror("safe_open (open)");
+ return OPEN_ERROR;
+ }
+
if (strcmp(abspath, "/") == 0) {
return fd;
}