summaryrefslogtreecommitdiff
path: root/networking/vconfig.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-04-12 17:55:51 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-04-12 17:55:51 +0000
commitdac7ff15b7d32deeeef3d9665744fc5774c21d70 (patch)
tree0e4c34863628d79fdad0c6217f4deb0ca0a91c33 /networking/vconfig.c
parent79865bc5077cf6d17b27e9599921d4c85b1575fd (diff)
downloadbusybox-w32-dac7ff15b7d32deeeef3d9665744fc5774c21d70.tar.gz
busybox-w32-dac7ff15b7d32deeeef3d9665744fc5774c21d70.tar.bz2
busybox-w32-dac7ff15b7d32deeeef3d9665744fc5774c21d70.zip
- patch from Denis Vlasenko to add and use bb_xsocket() and to use
bb_xopen some more while at it. Also use shorter boilerplate while at it.
Diffstat (limited to 'networking/vconfig.c')
-rw-r--r--networking/vconfig.c26
1 files changed, 5 insertions, 21 deletions
diff --git a/networking/vconfig.c b/networking/vconfig.c
index 36458f784..72729c7ed 100644
--- a/networking/vconfig.c
+++ b/networking/vconfig.c
@@ -4,20 +4,7 @@
4 * 4 *
5 * Copyright (C) 2001 Manuel Novoa III <mjn3@codepoet.org> 5 * Copyright (C) 2001 Manuel Novoa III <mjn3@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 */ 8 */
22 9
23/* BB_AUDIT SUSv3 N/A */ 10/* BB_AUDIT SUSv3 N/A */
@@ -136,9 +123,7 @@ int vconfig_main(int argc, char **argv)
136 } 123 }
137 124
138 /* Don't bother closing the filedes. It will be closed on cleanup. */ 125 /* Don't bother closing the filedes. It will be closed on cleanup. */
139 if (open(conf_file_name, O_RDONLY) < 0) { /* Is 802.1q is present? */ 126 bb_xopen(conf_file_name, O_RDONLY); /* Will die if 802.1q is not present */
140 bb_perror_msg_and_die("open %s", conf_file_name);
141 }
142 127
143 memset(&ifr, 0, sizeof(struct vlan_ioctl_args)); 128 memset(&ifr, 0, sizeof(struct vlan_ioctl_args));
144 129
@@ -173,10 +158,9 @@ int vconfig_main(int argc, char **argv)
173 } 158 }
174 } 159 }
175 160
176 if (((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) 161 fd = bb_xsocket(AF_INET, SOCK_STREAM, 0);
177 || (ioctl(fd, SIOCSIFVLAN, &ifr) < 0) 162 if (ioctl(fd, SIOCSIFVLAN, &ifr) < 0) {
178 ) { 163 bb_perror_msg_and_die("ioctl error for %s", *argv);
179 bb_perror_msg_and_die("socket or ioctl error for %s", *argv);
180 } 164 }
181 165
182 return 0; 166 return 0;