mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Add find(1) symbolic link support.
This commit is contained in:
parent
4333b2e695
commit
ba5af691f9
1 changed files with 2 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2013.
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2013, 2015.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the Free
|
||||
|
@ -53,7 +53,7 @@ const int TYPE_DIR = 1 << 1;
|
|||
bool Find(int dirfd, const char* relpath, const char* path, int types)
|
||||
{
|
||||
bool ret = true;
|
||||
int fd = openat(dirfd, relpath, O_RDONLY);
|
||||
int fd = openat(dirfd, relpath, O_RDONLY | O_SYMLINK_NOFOLLOW);
|
||||
if ( fd < 0 ) { error(0, errno, "%s", path); return false; }
|
||||
struct stat st;
|
||||
if ( fstat(fd, &st) ) { error(0, errno, "stat: %s", path); return false; }
|
||||
|
|
Loading…
Add table
Reference in a new issue