X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=networking%2Fvconfig.c;h=6cbbb54ca13267071cad9f935699ad80ba7a5fc8;hb=c44bc986b738977c5cd9741d9752a41ac022602f;hp=36458f784b81671c5bd36a2cac7f2ccbd3ea3aa4;hpb=c1ef7bdd8d002ae0889efcf883d0e1b7faa938d4;p=oweals%2Fbusybox.git diff --git a/networking/vconfig.c b/networking/vconfig.c index 36458f784..6cbbb54ca 100644 --- a/networking/vconfig.c +++ b/networking/vconfig.c @@ -4,20 +4,7 @@ * * Copyright (C) 2001 Manuel Novoa III * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. */ /* BB_AUDIT SUSv3 N/A */ @@ -136,9 +123,8 @@ int vconfig_main(int argc, char **argv) } /* Don't bother closing the filedes. It will be closed on cleanup. */ - if (open(conf_file_name, O_RDONLY) < 0) { /* Is 802.1q is present? */ - bb_perror_msg_and_die("open %s", conf_file_name); - } + /* Will die if 802.1q is not present */ + bb_xopen3(conf_file_name, O_RDONLY, 0); memset(&ifr, 0, sizeof(struct vlan_ioctl_args)); @@ -173,10 +159,9 @@ int vconfig_main(int argc, char **argv) } } - if (((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) - || (ioctl(fd, SIOCSIFVLAN, &ifr) < 0) - ) { - bb_perror_msg_and_die("socket or ioctl error for %s", *argv); + fd = bb_xsocket(AF_INET, SOCK_STREAM, 0); + if (ioctl(fd, SIOCSIFVLAN, &ifr) < 0) { + bb_perror_msg_and_die("ioctl error for %s", *argv); } return 0;