diff options
author | Rob Landley <rob@landley.net> | 2006-02-26 04:42:05 +0000 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2006-02-26 04:42:05 +0000 |
commit | 4217bab02edbc418b0346e222de32448e3390421 (patch) | |
tree | 9d6631050c43548bab67c178a0635b26a213f14b /networking/ifupdown.c | |
parent | 5ba2fb2c9dd23d99ebf69e0e71b4b6a845fb8eab (diff) | |
download | busybox-w32-4217bab02edbc418b0346e222de32448e3390421.tar.gz busybox-w32-4217bab02edbc418b0346e222de32448e3390421.tar.bz2 busybox-w32-4217bab02edbc418b0346e222de32448e3390421.zip |
Patch from Glenn McGrath to remove code that opens a file but does nothing
with it.
Diffstat (limited to '')
-rw-r--r-- | networking/ifupdown.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c index 34a43e6fa..ad9b99b55 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c | |||
@@ -1157,7 +1157,6 @@ extern int ifupdown_main(int argc, char **argv) | |||
1157 | { | 1157 | { |
1158 | int (*cmds) (struct interface_defn_t *) = NULL; | 1158 | int (*cmds) (struct interface_defn_t *) = NULL; |
1159 | struct interfaces_file_t *defn; | 1159 | struct interfaces_file_t *defn; |
1160 | FILE *state_fp = NULL; | ||
1161 | llist_t *state_list = NULL; | 1160 | llist_t *state_list = NULL; |
1162 | llist_t *target_list = NULL; | 1161 | llist_t *target_list = NULL; |
1163 | const char *interfaces = "/etc/network/interfaces"; | 1162 | const char *interfaces = "/etc/network/interfaces"; |
@@ -1230,10 +1229,6 @@ extern int ifupdown_main(int argc, char **argv) | |||
1230 | exit(EXIT_FAILURE); | 1229 | exit(EXIT_FAILURE); |
1231 | } | 1230 | } |
1232 | 1231 | ||
1233 | if (no_act) { | ||
1234 | state_fp = fopen(statefile, "r"); | ||
1235 | } | ||
1236 | |||
1237 | /* Create a list of interfaces to work on */ | 1232 | /* Create a list of interfaces to work on */ |
1238 | if (do_all) { | 1233 | if (do_all) { |
1239 | if (cmds == iface_up) { | 1234 | if (cmds == iface_up) { |
@@ -1398,9 +1393,8 @@ extern int ifupdown_main(int argc, char **argv) | |||
1398 | 1393 | ||
1399 | /* Actually write the new state */ | 1394 | /* Actually write the new state */ |
1400 | if (!no_act) { | 1395 | if (!no_act) { |
1396 | FILE *state_fp = NULL; | ||
1401 | 1397 | ||
1402 | if (state_fp) | ||
1403 | fclose(state_fp); | ||
1404 | state_fp = bb_xfopen(statefile, "a+"); | 1398 | state_fp = bb_xfopen(statefile, "a+"); |
1405 | 1399 | ||
1406 | if (ftruncate(fileno(state_fp), 0) < 0) { | 1400 | if (ftruncate(fileno(state_fp), 0) < 0) { |
@@ -1417,12 +1411,7 @@ extern int ifupdown_main(int argc, char **argv) | |||
1417 | state_list = state_list->link; | 1411 | state_list = state_list->link; |
1418 | } | 1412 | } |
1419 | fflush(state_fp); | 1413 | fflush(state_fp); |
1420 | } | ||
1421 | |||
1422 | /* Cleanup */ | ||
1423 | if (state_fp != NULL) { | ||
1424 | fclose(state_fp); | 1414 | fclose(state_fp); |
1425 | state_fp = NULL; | ||
1426 | } | 1415 | } |
1427 | 1416 | ||
1428 | if (any_failures) | 1417 | if (any_failures) |