]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blobdiff - io/fsmap.c
libfrog: convert fsgeom.c functions to negative error codes
[thirdparty/xfsprogs-dev.git] / io / fsmap.c
index 0bc8ae64bebe660af28ce6f0af4f7ad2bf930b46..feacb264a9d0755968e3ded9f9eab772c49e6059 100644 (file)
@@ -6,9 +6,10 @@
 #include "platform_defs.h"
 #include "command.h"
 #include "init.h"
-#include "path.h"
+#include "libfrog/paths.h"
 #include "io.h"
 #include "input.h"
+#include "libfrog/fsgeom.h"
 
 static cmdinfo_t       fsmap_cmd;
 static dev_t           xfs_data_dev;
@@ -364,7 +365,7 @@ dump_verbose_key(void)
                NFLG+1, NFLG+1, FLG_ESW);
 }
 
-int
+static int
 fsmap_f(
        int                     argc,
        char                    **argv)
@@ -447,11 +448,11 @@ fsmap_f(
        }
 
        if (vflag) {
-               c = ioctl(file->fd, XFS_IOC_FSGEOMETRY, &fsgeo);
-               if (c < 0) {
+               c = -xfrog_geometry(file->fd, &fsgeo);
+               if (c) {
                        fprintf(stderr,
                                _("%s: can't get geometry [\"%s\"]: %s\n"),
-                               progname, file->name, strerror(errno));
+                               progname, file->name, strerror(c));
                        exitcode = 1;
                        return 0;
                }