openat() opens only the next directory (and doesn't recurse). */
*firstslash = '\0';
int fd = safe_open_ex(at_fd, pathname, flags);
+ if (fd == -1) {
+ if (errno != ELOOP) {
+ /* Don't output anything if we ignore a symlink */
+ perror("safe_open_ex (safe_open_ex)");
+ }
+ return -1;
+ }
/* The ++ is safe because there needs to be at least a null byte
after the first slash, even if it's the last real character in