Skip to content

Commit

Permalink
Fix stat usage in FreeBSD
Browse files Browse the repository at this point in the history
Signed-off-by: Artem Senichev <[email protected]>
  • Loading branch information
artemsen committed Jan 8, 2025
1 parent c50ad00 commit 56616ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ static enum loader_status image_from_file(struct image* img, const char* file)
int fd;

// check file type
if (stat(file, &st) == -1 || (st.st_mode & S_IFMT) != S_IFREG) {
if (lstat(file, &st) == -1 || !S_ISREG(st.st_mode)) {
return ldr_ioerror;
}

Expand Down

0 comments on commit 56616ca

Please sign in to comment.