Skip to content

Commit

Permalink
stat: s/ENODATA/ENOTSUP, since ENODATA is POSIX-optional
Browse files Browse the repository at this point in the history
Fixes half of #40.
  • Loading branch information
tavianator committed Jan 3, 2019
1 parent f28298b commit 89802c0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ static int bfs_statx_impl(int at_fd, const char *at_path, int at_flags, enum bfs
}

// Callers shouldn't have to check anything except the times
const int guaranteed = STATX_BASIC_STATS ^ (STATX_ATIME | STATX_CTIME | STATX_MTIME);
const unsigned int guaranteed = STATX_BASIC_STATS ^ (STATX_ATIME | STATX_CTIME | STATX_MTIME);
if ((xbuf.stx_mask & guaranteed) != guaranteed) {
errno = ENODATA;
errno = ENOTSUP;
return -1;
}

Expand Down Expand Up @@ -308,7 +308,7 @@ int bfs_fstat(int fd, struct bfs_stat *buf) {

const struct timespec *bfs_stat_time(const struct bfs_stat *buf, enum bfs_stat_field field) {
if (!(buf->mask & field)) {
errno = ENODATA;
errno = ENOTSUP;
return NULL;
}

Expand Down

0 comments on commit 89802c0

Please sign in to comment.