Patchwork qga/commands-posix.c: Fix typo in error message

login
register
mail settings
Submitter Peter Maydell
Date May 9, 2012, 2:12 p.m.
Message ID <1336572749-12718-1-git-send-email-peter.maydell@linaro.org>
Download mbox | patch
Permalink /patch/157966/
State New
Headers show

Comments

Peter Maydell - May 9, 2012, 2:12 p.m.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
NB: might trivially textually conflict with Jim Meyering's
strncpy fix here. (I spotted this typo in the context lines
for his patch...)

 qga/commands-posix.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Jim Meyering - May 9, 2012, 2:41 p.m.
Peter Maydell wrote:
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> NB: might trivially textually conflict with Jim Meyering's
> strncpy fix here. (I spotted this typo in the context lines
> for his patch...)
>
>  qga/commands-posix.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/qga/commands-posix.c b/qga/commands-posix.c
> index d58730a..0878ec7 100644
> --- a/qga/commands-posix.c
> +++ b/qga/commands-posix.c
> @@ -789,7 +789,7 @@ GuestNetworkInterfaceList *qmp_guest_network_get_interfaces(Error **errp)
>              strncpy(ifr.ifr_name,  info->value->name, IF_NAMESIZE);
>              if (ioctl(sock, SIOCGIFHWADDR, &ifr) == -1) {
>                  snprintf(err_msg, sizeof(err_msg),
> -                         "failed to get MAC addres of %s: %s",
> +                         "failed to get MAC address of %s: %s",
>                           ifa->ifa_name,
>                           strerror(errno));
>                  error_set(errp, QERR_QGA_COMMAND_FAILED, err_msg);

Obviously fine.
Reminds me of the misspellings script that was recently run on coreutils:

  http://github.com/lyda/misspell-check

It finds common misspellings in comments and code.
There were a few false positives (rela->real, where "rela" is a variable
name), but otherwise it works well:

I ran this to identify the culprits and to massage its
output into a sed script to fix them:

git ls-files|grep -vF .bin | misspellings -f - |grep -v '^ERROR:' |perl \
  -pe 's/^(.*?)\[(\d+)\]: (\w+) -> "(.*?)"$/sed -i '\''${2}s!$3!$4!'\'' $1/' > k

With one more manual tweak (it wasn't sure if "addres"
should be "adders" or "address", so the sed syntax wasn't right),
I got this:

  sed -i '450s!thru!through!' Changelog
  sed -i '260s!neccessary!necessary!' coroutine-sigaltstack.c
  sed -i '54s!miniscule!minuscule!' disas.c
  sed -i '1094s!thru!through!' hw/usb/hcd-ehci.c
  sed -i '1095s!thru!through!' hw/usb/hcd-ehci.c
  sed -i '21s!unecessary!unnecessary!' qapi-schema-guest.json
  sed -i '307s!explictly!explicitly!' qemu-ga.c
  sed -i '490s!preceeding!preceding!' qga/commands-posix.c
  sed -i '792s!addres!address!' qga/commands-posix.c
  sed -i '6s!beeing!being!' tests/tcg/test-mmap.c

Which induces the change I'm posting separately.

Patch

diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index d58730a..0878ec7 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -789,7 +789,7 @@  GuestNetworkInterfaceList *qmp_guest_network_get_interfaces(Error **errp)
             strncpy(ifr.ifr_name,  info->value->name, IF_NAMESIZE);
             if (ioctl(sock, SIOCGIFHWADDR, &ifr) == -1) {
                 snprintf(err_msg, sizeof(err_msg),
-                         "failed to get MAC addres of %s: %s",
+                         "failed to get MAC address of %s: %s",
                          ifa->ifa_name,
                          strerror(errno));
                 error_set(errp, QERR_QGA_COMMAND_FAILED, err_msg);