git » drill.git » commit be8b994

Make fallocate() error handling more readable

author Rodrigo Campos
2014-01-20 16:28:38 UTC
committer Rodrigo Campos
2014-01-20 16:56:37 UTC
parent f65c43b587311c9a3fd18209be88fa02779da656

Make fallocate() error handling more readable

Besides it was pretty simple and clear before, like this it seems more like an
English sentence and is equally correct.

Signed-off-by: Rodrigo Campos <rodrigo@sdfg.com.ar>

drill.c +3 -3

diff --git a/drill.c b/drill.c
index 54ddce2..9fd1287 100644
--- a/drill.c
+++ b/drill.c
@@ -60,12 +60,12 @@ size_t parse_hole_size(char *optarg)
 
 int dig_hole(int fd, off_t offset, off_t length)
 {
-	int r = fallocate(fd, FALLOC_FL_PUNCH_HOLE|FALLOC_FL_KEEP_SIZE,
+	int err = fallocate(fd, FALLOC_FL_PUNCH_HOLE|FALLOC_FL_KEEP_SIZE,
 	                  offset, length);
-	if (r == -1)
+	if (err)
 		perror("fallocate failed");
 
-	return r;
+	return err;
 }
 
 /*