diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2006-04-12 17:55:51 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2006-04-12 17:55:51 +0000 |
commit | dac7ff15b7d32deeeef3d9665744fc5774c21d70 (patch) | |
tree | 0e4c34863628d79fdad0c6217f4deb0ca0a91c33 /networking/ifconfig.c | |
parent | 79865bc5077cf6d17b27e9599921d4c85b1575fd (diff) | |
download | busybox-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/ifconfig.c')
-rw-r--r-- | networking/ifconfig.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/networking/ifconfig.c b/networking/ifconfig.c index 1e1bd83ee..7b358c43f 100644 --- a/networking/ifconfig.c +++ b/networking/ifconfig.c | |||
@@ -1,3 +1,4 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | ||
1 | /* ifconfig | 2 | /* ifconfig |
2 | * | 3 | * |
3 | * Similar to the standard Unix ifconfig, but with only the necessary | 4 | * Similar to the standard Unix ifconfig, but with only the necessary |
@@ -9,14 +10,7 @@ | |||
9 | * Authors of the original ifconfig was: | 10 | * Authors of the original ifconfig was: |
10 | * Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> | 11 | * Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> |
11 | * | 12 | * |
12 | * This program is free software; you can redistribute it | 13 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
13 | * and/or modify it under the terms of the GNU General | ||
14 | * Public License as published by the Free Software | ||
15 | * Foundation; either version 2 of the License, or (at | ||
16 | * your option) any later version. | ||
17 | * | ||
18 | * $Id: ifconfig.c,v 1.30 2004/03/31 11:30:08 andersen Exp $ | ||
19 | * | ||
20 | */ | 14 | */ |
21 | 15 | ||
22 | /* | 16 | /* |
@@ -335,9 +329,7 @@ int ifconfig_main(int argc, char **argv) | |||
335 | } | 329 | } |
336 | 330 | ||
337 | /* Create a channel to the NET kernel. */ | 331 | /* Create a channel to the NET kernel. */ |
338 | if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { | 332 | sockfd = bb_xsocket(AF_INET, SOCK_DGRAM, 0); |
339 | bb_perror_msg_and_die("socket"); | ||
340 | } | ||
341 | 333 | ||
342 | /* get interface name */ | 334 | /* get interface name */ |
343 | safe_strncpy(ifr.ifr_name, *argv, IFNAMSIZ); | 335 | safe_strncpy(ifr.ifr_name, *argv, IFNAMSIZ); |