]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blobdiff - rtcp/xfs_rtcp.c
libfrog: convert fsgeom.c functions to negative error codes
[thirdparty/xfsprogs-dev.git] / rtcp / xfs_rtcp.c
index 705e9589cdc735c29a51f98e42191889d12bdd0e..7c4197b1314ceb1a6e6d8075ab6d0582da2eb459 100644 (file)
@@ -1,30 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc.
  * All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write the Free Software Foundation,
- * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 #include "libxfs.h"
+#include "libfrog/fsgeom.h"
 
 int rtcp(char *, char *, int);
 int xfsrtextsize(char *path);
 
-int pflag;
+static int pflag;
 char *progname;
 
-void
+static void
 usage(void)
 {
        fprintf(stderr, _("%s [-e extsize] [-p] [-V] source target\n"), progname);
@@ -380,8 +369,8 @@ rtcp( char *source, char *target, int fextsize)
 int
 xfsrtextsize( char *path)
 {
-       int fd, rval, rtextsize;
-       xfs_fsop_geom_v1_t geo;
+       struct xfs_fsop_geom    geo;
+       int                     fd, rval, rtextsize;
 
        fd = open( path, O_RDONLY );
        if ( fd < 0 ) {
@@ -389,9 +378,9 @@ xfsrtextsize( char *path)
                        progname, path, strerror(errno));
                return -1;
        }
-       rval = xfsctl( path, fd, XFS_IOC_FSGEOMETRY_V1, &geo );
+       rval = -xfrog_geometry(fd, &geo);
        close(fd);
-       if ( rval < 0 )
+       if (rval)
                return -1;
 
        rtextsize = geo.rtextsize * geo.blocksize;