From 891aac7a0c35eb25f853c3960eadf8f1f22ca60b Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Fri, 12 Mar 2010 09:47:38 +0000 Subject: [PATCH] guestfish: Use xstrtoll to parse Int params (RHBZ#569757 RHBZ#567567). Change guestfish so it uses xstrtoll to parse Int (31 bit) parameters. This fixes two bugs on 32 bit platforms which failed when long = 32 bits. long long = 64 bits on both. --- regressions/rhbz557655-expected.stderr | 8 ++++---- src/generator.ml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/regressions/rhbz557655-expected.stderr b/regressions/rhbz557655-expected.stderr index ea560e8..c8e02f5 100644 --- a/regressions/rhbz557655-expected.stderr +++ b/regressions/rhbz557655-expected.stderr @@ -2,10 +2,10 @@ set-memsize: memsize: integer out of range set-memsize: memsize: integer out of range set-memsize: memsize: integer out of range set-memsize: memsize: integer out of range -set-memsize: memsize: invalid integer parameter (xstrtol returned 4) -set-memsize: memsize: invalid integer parameter (xstrtol returned 2) -set-memsize: memsize: invalid integer parameter (xstrtol returned 2) -set-memsize: memsize: invalid integer parameter (xstrtol returned 2) +set-memsize: memsize: invalid integer parameter (xstrtoll returned 4) +set-memsize: memsize: invalid integer parameter (xstrtoll returned 2) +set-memsize: memsize: invalid integer parameter (xstrtoll returned 2) +set-memsize: memsize: invalid integer parameter (xstrtoll returned 2) libguestfs: error: truncate_size: ftruncate: /test: File too large truncate-size: size: invalid integer parameter (xstrtoll returned 1) truncate-size: size: invalid integer parameter (xstrtoll returned 4) diff --git a/src/generator.ml b/src/generator.ml index 96b5b70..fab2173 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -7221,7 +7221,7 @@ and generate_fish_cmds () = and comment = "The Int type in the generator is a signed 31 bit int." in Some (min, max, comment) in - parse_integer "xstrtol" "long" "int" range name i + parse_integer "xstrtoll" "long long" "int" range name i | Int64 name -> parse_integer "xstrtoll" "long long" "int64_t" None name i ) (snd style); -- 1.8.3.1