[libvirt] [PATCH] virt-aa-helper: Fix several compile errors

Eric Blake eblake at redhat.com
Wed Nov 17 20:48:28 UTC 2010


On 11/17/2010 01:39 PM, Matthias Bolte wrote:
> Include locale.h for setlocale().
> 
> Revert the usage string back to it's original form.
> 
> Use puts() instead of fputs(), as fputs() expects a FILE*.
> 
> Add closing parenthesis to some vah_error() calls.
> 
> Use argv[0] instead of an undefined argv0.
> ---
>  src/security/virt-aa-helper.c |   39 ++++++++++++++++++++-------------------
>  1 files changed, 20 insertions(+), 19 deletions(-)

ACK.  And that's what I get for passing 'make syntax-check' on Fedora,
but not testing on ubuntu before actually pushing.  :(

Sorry, and I'll go crawl back in my hole now.  ;)

>  {
> -    fprintf(stdout, _("\n%s [options] [< def.xml]\n\n
> -  Options:\n
> -    -a | --add                     load profile\n

This would have worked if I'd used line continuations (in fact, that's
what coreutils does, to get a good feel for where the 80 column boundary is:

  fprintf(stdout, _("\
...\n\
...\n\
", ...);

but those missing \ got me.

> +    printf(_("\n%s [options] [< def.xml]\n\n"
> +            "  Options:\n"
> +            "    -a | --add                     load profile\n"

But this approach works as well.

> @@ -289,7 +290,7 @@ update_include_file(const char *include_file, const char *included_files,
>      }
>  
>      if (VIR_CLOSE(fd) != 0) {
> -        vah_error(NULL, 0, _("failed to close or write to profile")_;
> +        vah_error(NULL, 0, _("failed to close or write to profile"));

I can't touch type very well, can I; my only excuse is that ) and _ are
neighbors.

> @@ -1140,7 +1141,7 @@ main(int argc, char **argv)
>      if (setlocale(LC_ALL, "") == NULL ||
>          bindtextdomain(PACKAGE, LOCALEDIR) == NULL ||
>          textdomain(PACKAGE) == NULL) {
> -        fprintf(stderr, _("%s: initialization failed\n"), argv0);
> +        fprintf(stderr, _("%s: initialization failed\n"), argv[0]);

copy-and-paste bytes again. :(

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20101117/9b0c2e5e/attachment-0001.sig>


More information about the libvir-list mailing list