* [PATCH] fix posix_fallocate() return value usage
@ 2010-06-25 15:25 Greg Edwards
2010-06-26 20:52 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Greg Edwards @ 2010-06-25 15:25 UTC (permalink / raw)
To: fio
posix_fallocate() returns the error number on failure. Fix the return value
usage.
Signed-off-by: Greg Edwards <greg.edwards@hp.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] fix posix_fallocate() return value usage
2010-06-25 15:25 [PATCH] fix posix_fallocate() return value usage Greg Edwards
@ 2010-06-26 20:52 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2010-06-26 20:52 UTC (permalink / raw)
To: Greg Edwards; +Cc: fio
On 25/06/10 17.25, Greg Edwards wrote:
> posix_fallocate() returns the error number on failure. Fix the return value
> usage.
Thanks, will apply.
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-06-26 20:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-25 15:25 [PATCH] fix posix_fallocate() return value usage Greg Edwards
2010-06-26 20:52 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox