Page MenuHomeFreeBSD

D3644.id8787.diff
No OneTemporary

D3644.id8787.diff

Index: head/sbin/ifconfig/ifconfig.c
===================================================================
--- head/sbin/ifconfig/ifconfig.c
+++ head/sbin/ifconfig/ifconfig.c
@@ -995,7 +995,7 @@
strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name));
ifr.ifr_metric = atoi(val);
if (ioctl(s, SIOCSIFMETRIC, (caddr_t)&ifr) < 0)
- warn("ioctl (set metric)");
+ err(1, "ioctl SIOCSIFMETRIC (set metric)");
}
static void
@@ -1005,7 +1005,7 @@
strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name));
ifr.ifr_mtu = atoi(val);
if (ioctl(s, SIOCSIFMTU, (caddr_t)&ifr) < 0)
- warn("ioctl (set mtu)");
+ err(1, "ioctl SIOCSIFMTU (set mtu)");
}
static void
@@ -1015,15 +1015,12 @@
char *newname;
newname = strdup(val);
- if (newname == NULL) {
- warn("no memory to set ifname");
- return;
- }
+ if (newname == NULL)
+ err(1, "no memory to set ifname");
ifr.ifr_data = newname;
if (ioctl(s, SIOCSIFNAME, (caddr_t)&ifr) < 0) {
- warn("ioctl (set name)");
free(newname);
- return;
+ err(1, "ioctl SIOCSIFNAME (set name)");
}
strlcpy(name, newname, sizeof(name));
free(newname);
@@ -1050,7 +1047,7 @@
}
if (ioctl(s, SIOCSIFDESCR, (caddr_t)&ifr) < 0)
- warn("ioctl (set descr)");
+ err(1, "ioctl SIOCSIFDESCR (set descr)");
free(newdescr);
}

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 2:46 PM (20 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15531014
Default Alt Text
D3644.id8787.diff (1 KB)

Event Timeline