]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
partx: cleanup strtoxx_or_err()
authorKarel Zak <kzak@redhat.com>
Tue, 15 May 2012 15:44:51 +0000 (17:44 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 15 May 2012 15:44:51 +0000 (17:44 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
partx/addpart.c
partx/delpart.c
partx/partx.h

index cd7e28ed751c554c31f74131dbadcd52eb3275d1..0d814bf3eea4e1ed13460782a93bc5cc4356c2bb 100644 (file)
@@ -52,9 +52,9 @@ int main(int argc, char **argv)
                err(EXIT_FAILURE, _("%s: open failed"), argv[1]);
 
        if (partx_add_partition(fd,
-                       strtol_or_err(argv[2], _("failed to parse partition number")),
-                       strtoll_or_err(argv[3],_("failed to parse start")),
-                       strtoll_or_err(argv[4],_("failed to parse length"))))
+                       strtou32_or_err(argv[2], _("invalid partition number argument")),
+                       strtou64_or_err(argv[3], _("invalid start argument")),
+                       strtou64_or_err(argv[4], _("invalid length argument"))))
                err(EXIT_FAILURE, _("failed to add partition"));
 
        return EXIT_SUCCESS;
index eb5d99e998b315ba25427ffd399333841efdb1b4..79925db89b213d720733beb8d3866067fff39e3e 100644 (file)
@@ -53,7 +53,7 @@ int main(int argc, char **argv)
                err(EXIT_FAILURE, _("%s: open failed"), argv[1]);
 
        if (partx_del_partition(fd,
-                       strtol_or_err(argv[2], _("failed to parse partition number"))))
+                       strtou32_or_err(argv[2], _("invalid partition number argument"))))
                err(EXIT_FAILURE, _("failed to remove partition"));
 
        return EXIT_SUCCESS;
index b40fa8fbd93c6be975edb9227c6b39cf6679bb99..ed0fd0aa422840e679c6851520e1e8c8662f92c1 100644 (file)
@@ -4,7 +4,7 @@
 #include <sys/ioctl.h>
 #include <linux/blkpg.h>
 
-static inline int partx_del_partition(int fd, int partno)
+static inline int partx_del_partition(int fd, unsigned int partno)
 {
        struct blkpg_ioctl_arg a;
        struct blkpg_partition p;
@@ -23,7 +23,7 @@ static inline int partx_del_partition(int fd, int partno)
 }
 
 static inline int partx_add_partition(int fd, int partno,
-                       unsigned long start, unsigned long size)
+                       uint64_t start, uint64_t size)
 {
        struct blkpg_ioctl_arg a;
        struct blkpg_partition p;