Pino Toscano
2019-Jan-16 17:52 UTC
[Libguestfs] [hivex PATCH] perl: fix format of croak for RLenValue
When calling croak on failure in the Perl code for RLenValue, add the %s placeholder for the strerror result. This makes the croak call just like all the others. Fixes commit 87e1be8ff3431ac81d721d5f647fc85d02e045dc. --- generator/generator.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generator/generator.ml b/generator/generator.ml index 0401217..f2cb627 100755 --- a/generator/generator.ml +++ b/generator/generator.ml @@ -2743,7 +2743,7 @@ DESTROY (h) name (String.concat ", " c_params); free_args (); pr " if (r == 0 && errno)\n"; - pr " croak (\"%%s: \", \"%s\", strerror (errno));\n" + pr " croak (\"%%s: %%s\", \"%s\", strerror (errno));\n" name; pr " EXTEND (SP, 2);\n"; pr " PUSHs (sv_2mortal (newSViv (len)));\n"; -- 2.20.1
Richard W.M. Jones
2019-Jan-17 13:40 UTC
Re: [Libguestfs] [hivex PATCH] perl: fix format of croak for RLenValue
On Wed, Jan 16, 2019 at 06:52:30PM +0100, Pino Toscano wrote:> When calling croak on failure in the Perl code for RLenValue, add the > %s placeholder for the strerror result. This makes the croak call just > like all the others. > > Fixes commit 87e1be8ff3431ac81d721d5f647fc85d02e045dc. > --- > generator/generator.ml | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/generator/generator.ml b/generator/generator.ml > index 0401217..f2cb627 100755 > --- a/generator/generator.ml > +++ b/generator/generator.ml > @@ -2743,7 +2743,7 @@ DESTROY (h) > name (String.concat ", " c_params); > free_args (); > pr " if (r == 0 && errno)\n"; > - pr " croak (\"%%s: \", \"%s\", strerror (errno));\n" > + pr " croak (\"%%s: %%s\", \"%s\", strerror (errno));\n" > name; > pr " EXTEND (SP, 2);\n"; > pr " PUSHs (sv_2mortal (newSViv (len)));\n"; > --ACK Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
Reasonably Related Threads
- [hivex][PATCH 2/8] generator: Add new return type to ABI: RLenValue
- [hivex] [PATCH 2/8] generator: Add new return type to ABI: RLenValue
- [hivex] Segfault for an integer value to node_set_value
- [hivex] [PATCH 0/6] Python fixes for node_set_value
- [PATCH] hivex: Add byte runs for nodes and values