diff options
author | Luke Shumaker <lukeshu@beefcake.parabola.nu> | 2018-05-18 12:51:36 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@beefcake.parabola.nu> | 2018-05-18 13:00:59 -0400 |
commit | 1e13f3671739e98f4e6d8531b9b22c93d24589f8 (patch) | |
tree | c480dd88275d9ae41b6a00e239cb0a0da130d096 /lib/extent-map.c | |
parent | 39eff20bd938bae630270a3f06b17f787663826c (diff) |
pull strextentflags in to a function
Diffstat (limited to 'lib/extent-map.c')
-rw-r--r-- | lib/extent-map.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/extent-map.c b/lib/extent-map.c index 297448c..ab9cfb0 100644 --- a/lib/extent-map.c +++ b/lib/extent-map.c @@ -8,8 +8,6 @@ #include "extent-map.h" -#define error(_exit_code, ...) do { error(0, __VA_ARGS__); if (_exit_code) return _exit_code; } while(0) - int fiemap(int fd, uint32_t flags, int (*handle_extent)(struct fiemap_extent)) { const size_t fm_size = sysconf(_SC_PAGESIZE);; struct fiemap *fm = calloc(1, fm_size); @@ -25,7 +23,7 @@ int fiemap(int fd, uint32_t flags, int (*handle_extent)(struct fiemap_extent)) { }; if (ioctl(fd, FS_IOC_FIEMAP, fm) < 0) - error(EXIT_FAILURE, errno, "ioctl (FS_IOC_FIEMAP)"); + return -errno; for (size_t i = 0; i < fm->fm_extent_count; i++) { int r = handle_extent(fm->fm_extents[i]); |