fix return value

This commit is contained in:
anon
2025-01-26 15:20:02 +01:00
parent 9799a872c4
commit fa2e41dd7b
2 changed files with 2 additions and 2 deletions

View File

@ -24,7 +24,7 @@ int remove_wrapper(
int remove_all(const char * const p) { int remove_all(const char * const p) {
#define NOPENFD 256 #define NOPENFD 256
const int result = nftw(p, remove_wrapper, NOPENFD, FTW_DEPTH | FTW_PHYS); const int result = nftw(p, remove_wrapper, NOPENFD, FTW_DEPTH | FTW_PHYS);
if (result) { return 1; } if (result) { return -1; }
return 0; return 0;
#undef NOPENFD #undef NOPENFD

2
test.c
View File

@ -2,5 +2,5 @@
#include "remove_all.h" #include "remove_all.h"
signed main(void) { signed main(void) {
return remove_all("testdir/"); return (remove_all("testdir/") == -1);
} }