From: Jens Axboe Date: Thu, 2 Nov 2017 15:07:11 +0000 (-0600) Subject: filesetup: recurse_dir() can use bool X-Git-Tag: fio-3.2~7 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=13bddad990ba2c268415e9dcbdc5dfa40f7c6cd3;ds=sidebyside filesetup: recurse_dir() can use bool Signed-off-by: Jens Axboe --- diff --git a/filesetup.c b/filesetup.c index 1c36ff8f..9ead8cd0 100644 --- a/filesetup.c +++ b/filesetup.c @@ -1737,10 +1737,10 @@ void unlock_file_all(struct thread_data *td, struct fio_file *f) unlock_file(td, f); } -static int recurse_dir(struct thread_data *td, const char *dirname) +static bool recurse_dir(struct thread_data *td, const char *dirname) { struct dirent *dir; - int ret = 0; + bool ret = false; DIR *D; D = opendir(dirname); @@ -1749,7 +1749,7 @@ static int recurse_dir(struct thread_data *td, const char *dirname) snprintf(buf, FIO_VERROR_SIZE, "opendir(%s)", dirname); td_verror(td, errno, buf); - return 1; + return true; } while ((dir = readdir(D)) != NULL) { @@ -1764,7 +1764,7 @@ static int recurse_dir(struct thread_data *td, const char *dirname) if (lstat(full_path, &sb) == -1) { if (errno != ENOENT) { td_verror(td, errno, "stat"); - ret = 1; + ret = true; break; } }