Package: wireless-tools
Version: 29-1.1
Severity: normal
Tags: patch

When iwconfig is currently run with an ethernet device as an argument,
it displays "no wireless extensions". But it doesn't give a proper exit
code.

I noticed that the exit status is propagated but not stored in main().
Thus this patch.

Did a brief testing, looks good to me.

r...@champaran:/tmp/wireless-tools-29$ iwconfig eth1
eth1      IEEE 802.11g  ESSID:"rrs"
          Mode:Managed  Frequency:2.437 GHz  Access Point:
00:16:B6:A5:E7:1C
          Bit Rate:54 Mb/s   Tx-Power=20 dBm   Sensitivity=8/0
          Retry limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=78/100  Signal level=-51 dBm  Noise level=-90 dBm
          Rx invalid nwid:0  Rx invalid crypt:6  Rx invalid frag:0
          Tx excessive retries:1  Invalid misc:0   Missed beacon:0

r...@champaran:/tmp/wireless-tools-29$ echo $?
0
r...@champaran:/tmp/wireless-tools-29$ iwconfig eth0
eth0      no wireless extensions.

r...@champaran:/tmp/wireless-tools-29$ echo $?
161
r...@champaran:/tmp/wireless-tools-29$ iwconfig eth0
eth0      no wireless extensions.

r...@champaran:/tmp/wireless-tools-29$ echo $?
161
r...@champaran:/tmp/wireless-tools-29$ iwconfig eth0
eth0      no wireless extensions.

r...@champaran:/tmp/wireless-tools-29$ echo $?
161


I just checked iwconfig for now, am not sure if similar problems are
there elsewhere also.

Ritesh

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.29-1-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages wireless-tools depends on:
ii  libc6                         2.9-8      GNU C Library: Shared libraries
ii  libiw29                       29-1.1     Wireless tools - library

wireless-tools recommends no packages.

wireless-tools suggests no packages.

-- no debconf information
1913c1913
<   int goterr = 0;
---
>   int ret = 0;
1932c1932
<       goterr = iw_print_version_info("iwconfig");
---
>       ret = iw_print_version_info("iwconfig");
1944c1944
<           print_info(skfd, argv[1], NULL, 0);
---
>           ret = print_info(skfd, argv[1], NULL, 0);
1947c1947
<           goterr = set_info(skfd, argv + 2, argc - 2, argv[1]);
---
>           ret = set_info(skfd, argv + 2, argc - 2, argv[1]);
1953c1953
<   return(goterr);
---
>   return(ret);

Reply via email to