]> git.ipfire.org Git - thirdparty/util-linux.git/commit
fallocate: Hide #ifdef tricks to call fallocate in a function
authorRodrigo Campos <rodrigo@sdfg.com.ar>
Sat, 25 Jan 2014 19:17:27 +0000 (19:17 +0000)
committerKarel Zak <kzak@redhat.com>
Fri, 14 Feb 2014 10:00:41 +0000 (11:00 +0100)
commitbcd9315d4ba62a225028c47b0423e390e19381f6
treee8b05dda1c4f5df01695b22d9dcc07aed0c61967
parenta8d10d1c9d13f3a5366b7ece635c02e356965c2d
fallocate: Hide #ifdef tricks to call fallocate in a function

Future patches will add more calls to fallocate(), so it will be useful to have
all these tricks inside a function.

The error message when fallocate is not supported is slightly changed: the file
name is not printed as a prefix because is not available in the context of the
function. Also, to only print one of the two possible errors (as happens when
using directly exit()), an else clause was added.

Signed-off-by: Rodrigo Campos <rodrigo@sdfg.com.ar>
sys-utils/fallocate.c