[PATCH] fix posix_fallocate() return value usage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



posix_fallocate() returns the error number on failure.  Fix the return value
usage.

Signed-off-by: Greg Edwards <greg.edwards@xxxxxx>
---
 filesetup.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/filesetup.c b/filesetup.c
index b90d12a..f088390 100644
--- a/filesetup.c
+++ b/filesetup.c
@@ -71,9 +71,9 @@ static int extend_file(struct thread_data *td, struct fio_file *f)
 							f->real_file_size);
 
 		r = posix_fallocate(f->fd, 0, f->real_file_size);
-		if (r < 0) {
+		if (r > 0) {
 			log_err("fio: posix_fallocate fails: %s\n",
-					strerror(-r));
+					strerror(r));
 		}
 	}
 #endif
-- 
1.7.0.5

--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux