Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/tup/entry.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,19 @@ static int entry_openat_internal(int root_dfd, struct tup_entry *tent)
if(!tent)
return -1;
if(tent->parent == NULL) {
return fcntl(root_dfd, F_DUPFD_CLOEXEC, 0);
#ifdef F_DUPFD_CLOEXEC
int fd = fcntl(root_dfd, F_DUPFD_CLOEXEC, 0);
if(fd != -1 || errno != EINVAL)
return fd;
#endif
int fd = fcntl(root_dfd, F_DUPFD, 0);
if(fd == -1)
return -1;
if(fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) {
close(fd);
return -1;
}
return fd;
}

dfd = entry_openat_internal(root_dfd, tent->parent);
Expand Down
4 changes: 2 additions & 2 deletions src/tup/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ const char *tup_platform = "netbsd";
const char *tup_arch = "x86_64";
#elif __i386__
const char *tup_arch = "i386";
#elif __powerpc__
#elif __powerpc__ || __ppc__
const char *tup_arch = "powerpc";
#elif __powerpc64__
#elif __powerpc64__ || __ppc64__
const char *tup_arch = "powerpc64";
#elif __ia64__
const char *tup_arch = "ia64";
Expand Down