fix return value
This commit is contained in:
parent
9799a872c4
commit
fa2e41dd7b
@ -24,7 +24,7 @@ int remove_wrapper(
|
||||
int remove_all(const char * const p) {
|
||||
#define NOPENFD 256
|
||||
const int result = nftw(p, remove_wrapper, NOPENFD, FTW_DEPTH | FTW_PHYS);
|
||||
if (result) { return 1; }
|
||||
if (result) { return -1; }
|
||||
|
||||
return 0;
|
||||
#undef NOPENFD
|
||||
|
2
test.c
2
test.c
@ -2,5 +2,5 @@
|
||||
#include "remove_all.h"
|
||||
|
||||
signed main(void) {
|
||||
return remove_all("testdir/");
|
||||
return (remove_all("testdir/") == -1);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user