Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F105714590
D3644.id8787.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D3644.id8787.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D3644: Make ifconfig always exit with an error code if an ioctl fails
Attached
Detach File
Event Timeline
Log In to Comment