Search Linux Wireless

Re: [PATCH] crda: use strerror() to report error code verbosely

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 22, 2008 at 9:00 PM, Pavel Roskin <proski@xxxxxxx> wrote:
> Signed-off-by: Pavel Roskin <proski@xxxxxxx>
> ---
>  crda.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/crda.c b/crda.c
> index afc5df1..fe2766b 100644
> --- a/crda.c
> +++ b/crda.c
> @@ -6,6 +6,7 @@
>
>  #include <errno.h>
>  #include <stdio.h>
> +#include <string.h>
>  #include <sys/mman.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> @@ -297,7 +298,8 @@ int main(int argc, char **argv)
>        r = nl_send_auto_complete(nlstate.nl_handle, msg);
>
>        if (r < 0) {
> -               fprintf(stderr, "Failed to send regulatory request: %d\n", r);
> +               fprintf(stderr, "Failed to send regulatory request: %s\n",
> +                       strerror(-r));
>                goto cb_out;
>        }
>
> @@ -309,7 +311,7 @@ int main(int argc, char **argv)
>                r = nl_wait_for_ack(nlstate.nl_handle);
>                if (r < 0) {
>                        fprintf(stderr, "Failed to set regulatory domain: "
> -                               "%d\n", r);
> +                               "%s\n", strerror(-r));
>                        goto cb_out;
>                }
>        }

I've been trying to avoid string.h on crda.c, granted it only
increases the final crda binary by about 30 bytes, but do we really
need it? In fact it'd be nice to further trim crda further to save
even more space. Thoughts?

  Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux