wget: -O FILE is allowed to overwrite existing file (compat)
[oweals/busybox.git] / networking / nameif.c
index ec77512c3e2949901fa89955568f0f7510041272..2114516a7af980feae6d27b5cc55bf8ed795833e 100644 (file)
@@ -4,12 +4,12 @@
  *
  * Written 2000 by Andi Kleen.
  * Busybox port 2002 by Nick Fedchik <nick@fedchik.org.ua>
- *                     Glenn McGrath <bug1@iinet.net.au>
+ *                     Glenn McGrath 
  *
  * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
  */
 
-#include "busybox.h"
+#include "libbb.h"
 #include <syslog.h>
 #include <net/if.h>
 #include <netinet/ether.h>
@@ -66,7 +66,7 @@ int nameif_main(int argc, char **argv)
        int if_index = 1;
        mactable_t *ch;
 
-       if (1 & getopt32(argc, argv, "sc:", &fname)) {
+       if (1 & getopt32(argv, "sc:", &fname)) {
                openlog(applet_name, 0, LOG_LOCAL0);
                logmode = LOGMODE_SYSLOG;
        }
@@ -148,9 +148,9 @@ int nameif_main(int argc, char **argv)
                        continue;
 
                strcpy(ifr.ifr_newname, ch->ifname);
-               if (ioctl(ctl_sk, SIOCSIFNAME, &ifr) < 0)
-                       bb_perror_msg_and_die("cannot change ifname %s to %s",
-                                  ifr.ifr_name, ch->ifname);
+               ioctl_or_perror_and_die(ctl_sk, SIOCSIFNAME, &ifr,
+                                       "cannot change ifname %s to %s",
+                                       ifr.ifr_name, ch->ifname);
 
                /* Remove list entry of renamed interface */
                if (ch->prev != NULL) {