summaryrefslogtreecommitdiffstats
path: root/commands/net.c
diff options
context:
space:
mode:
Diffstat (limited to 'commands/net.c')
-rw-r--r--commands/net.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/commands/net.c b/commands/net.c
index faf87d6ec6..93c6365ef6 100644
--- a/commands/net.c
+++ b/commands/net.c
@@ -216,16 +216,16 @@ netboot_common (proto_t proto, cmd_tbl_t *cmdtp, int argc, char *argv[])
safe_strncpy (BootFile, remotefile, sizeof(BootFile));
- if ((size = NetLoop(proto)) < 0)
- return 1;
+ if ((size = NetLoop(proto)) < 0) {
+ rcode = size;
+ goto out;
+ }
/* NetLoop ok, update environment */
netboot_update_env();
- /* done if no file was loaded (no errors though) */
- if (size == 0)
- return 0;
-
+out:
+ close(net_store_fd);
return rcode;
}