aboutsummaryrefslogtreecommitdiff
path: root/hostname.c
diff options
context:
space:
mode:
Diffstat (limited to 'hostname.c')
-rw-r--r--hostname.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/hostname.c b/hostname.c
index 573c8cece..d87851509 100644
--- a/hostname.c
+++ b/hostname.c
@@ -1,6 +1,6 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * $Id: hostname.c,v 1.29 2001/06/23 13:49:14 andersen Exp $ 3 * $Id: hostname.c,v 1.30 2001/06/26 02:06:08 bug1 Exp $
4 * Mini hostname implementation for busybox 4 * Mini hostname implementation for busybox
5 * 5 *
6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> 6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@ -49,10 +49,11 @@ static void do_sethostname(char *s, int isfile)
49 } else { 49 } else {
50 f = xfopen(s, "r"); 50 f = xfopen(s, "r");
51 fgets(buf, 255, f); 51 fgets(buf, 255, f);
52#ifdef BB_FEATURE_CLEAN_UP
52 fclose(f); 53 fclose(f);
54#endif
53 chomp(buf); 55 chomp(buf);
54 if (sethostname(buf, strlen(buf)) < 0) 56 do_sethostname(buf, 0);
55 perror_msg_and_die("sethostname");
56 } 57 }
57} 58}
58 59