diff options
author | midipix <writeonce@midipix.org> | 2021-04-13 16:46:12 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2021-04-15 08:03:31 +0000 |
commit | 7ae5c14d2b4cc2dce023dac9bdf6020962c7bcec (patch) | |
tree | d00fe17ad2871f6c8c0090e75653ad23bba963f4 /src/logic/slbt_exec_uninstall.c | |
parent | c2a0f5a12171cbdb1915bad18cf0c48c790a1972 (diff) | |
download | slibtool-7ae5c14d2b4cc2dce023dac9bdf6020962c7bcec.tar.bz2 slibtool-7ae5c14d2b4cc2dce023dac9bdf6020962c7bcec.tar.xz |
library: replace all uses of stat() and lstat() with fstatat() counterparts.
Diffstat (limited to 'src/logic/slbt_exec_uninstall.c')
-rw-r--r-- | src/logic/slbt_exec_uninstall.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/logic/slbt_exec_uninstall.c b/src/logic/slbt_exec_uninstall.c index 28a73b2..9f2521c 100644 --- a/src/logic/slbt_exec_uninstall.c +++ b/src/logic/slbt_exec_uninstall.c @@ -68,13 +68,18 @@ static int slbt_exec_uninstall_fs_entry( uint32_t flags) { struct stat st; + int fdcwd; char * slash; char dpath[PATH_MAX]; + /* fdcwd */ + fdcwd = slbt_driver_fdcwd(dctx); + /* needed? */ - if (stat(path,&st) && (errno == ENOENT)) - if (lstat(path,&st) && (errno == ENOENT)) - return 0; + if (fstatat(fdcwd,path,&st,0) && (errno == ENOENT)) + if (fstatat(fdcwd,path,&st,AT_SYMLINK_NOFOLLOW)) + if (errno == ENOENT) + return 0; /* output */ *parg = path; |