]> git.ipfire.org Git - people/stevee/pakfire.git/commit
file: Be smarter when removing files
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 24 Mar 2023 15:56:41 +0000 (15:56 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 24 Mar 2023 15:58:37 +0000 (15:58 +0000)
commit84eee57a363363f1a94a1fed3f63861ba276c6b8
treeec7da288c604071d6397026ecb8b42f28fb3a5e4
parent1f5bf4f85c6479a0a98888b034a0792637956891
file: Be smarter when removing files

Before, when we tried to remove a file from the filesystem, we tried to
call unlink() and if that failed, we tried rmdir() instead.

This patch changes that we will call rmdir() in the first place for
directories and unlink() for everything else so that we can catch error
codes more granulary.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/file.c