diff options
author | Danny Al-Gaaf <danny.al-gaaf@bisect.de> | 2013-03-20 16:37:37 +0100 |
---|---|---|
committer | Danny Al-Gaaf <danny.al-gaaf@bisect.de> | 2013-03-20 16:37:37 +0100 |
commit | a8a5683e6dc20efd1beff8c3a1396bd9299cbe33 (patch) | |
tree | 66e377837d16fd77d5a8ba010c6799e6a67ab865 /qa | |
parent | f9c108c798488f44dd051087610b71715c21d31d (diff) | |
download | ceph-a8a5683e6dc20efd1beff8c3a1396bd9299cbe33.tar.gz |
test_short_dio_read.c: add proper error handling
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Diffstat (limited to 'qa')
-rw-r--r-- | qa/workunits/direct_io/test_short_dio_read.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/qa/workunits/direct_io/test_short_dio_read.c b/qa/workunits/direct_io/test_short_dio_read.c index f65ce4546bd..50248555740 100644 --- a/qa/workunits/direct_io/test_short_dio_read.c +++ b/qa/workunits/direct_io/test_short_dio_read.c @@ -22,7 +22,20 @@ int main() printf("writing first 3 bytes of 10k file\n"); r = write(fd, "foo", 3); + if (r == -1) { + err = errno; + printf("error: write() failed with: %d (%s)\n", err, strerror(err)); + close(fd); + exit(err); + } r = ftruncate(fd, 10000); + if (r == -1) { + err = errno; + printf("error: ftruncate() failed with: %d (%s)\n", err, strerror(err)); + close(fd); + exit(err); + } + fsync(fd); close(fd); |