tftpd: show requested file name in open error message
[oweals/busybox.git] / networking / pscan.c
index 28005ad57ee2056d858c86f7b5d535563a5509b9..2715ef2df2ae894f8e8421a6232d468c27e971ea 100644 (file)
@@ -5,6 +5,15 @@
  *
  * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
+//config:config PSCAN
+//config:      bool "pscan (6 kb)"
+//config:      default y
+//config:      help
+//config:      Simple network port scanner.
+
+//applet:IF_PSCAN(APPLET(pscan, BB_DIR_USR_BIN, BB_SUID_DROP))
+
+//kbuild:lib-$(CONFIG_PSCAN) += pscan.o
 
 //usage:#define pscan_trivial_usage
 //usage:       "[-cb] [-p MIN_PORT] [-P MAX_PORT] [-t TIMEOUT] [-T MIN_RTT] HOST"
@@ -66,8 +75,11 @@ int pscan_main(int argc UNUSED_PARAM, char **argv)
        unsigned rtt_4;
        unsigned start, diff;
 
-       opt_complementary = "=1"; /* exactly one non-option */
-       opt = getopt32(argv, "cbp:P:t:T:", &opt_min_port, &opt_max_port, &opt_timeout, &opt_min_rtt);
+       opt = getopt32(argv, "^"
+               "cbp:P:t:T:"
+               "\0" "=1", /* exactly one non-option */
+               &opt_min_port, &opt_max_port, &opt_timeout, &opt_min_rtt
+       );
        argv += optind;
        max_port = xatou_range(opt_max_port, 1, 65535);
        port = xatou_range(opt_min_port, 1, max_port);
@@ -157,7 +169,7 @@ int pscan_main(int argc UNUSED_PARAM, char **argv)
        }
        if (ENABLE_FEATURE_CLEAN_UP) free(lsap);
 
-       printf("%d closed, %d open, %d timed out (or blocked) ports\n",
+       printf("%u closed, %u open, %u timed out (or blocked) ports\n",
                                        closed_ports,
                                        open_ports,
                                        nports - (closed_ports + open_ports));