aboutsummaryrefslogtreecommitdiff
path: root/networking/hostname.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/hostname.c')
-rw-r--r--networking/hostname.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/networking/hostname.c b/networking/hostname.c
index 6d3b8ebb8..7116a14df 100644
--- a/networking/hostname.c
+++ b/networking/hostname.c
@@ -48,11 +48,12 @@ int hostname_main(int argc, char **argv)
48 OPT_f = 0x2, 48 OPT_f = 0x2,
49 OPT_i = 0x4, 49 OPT_i = 0x4,
50 OPT_s = 0x8, 50 OPT_s = 0x8,
51 OPT_F = 0x8,
51 OPT_dfis = 0xf, 52 OPT_dfis = 0xf,
52 }; 53 };
53 54
54 char buf[256]; 55 char buf[256];
55 char *hostname_str = NULL; 56 char *hostname_str;
56 57
57 if (argc < 1) 58 if (argc < 1)
58 bb_show_usage(); 59 bb_show_usage();
@@ -70,7 +71,7 @@ int hostname_main(int argc, char **argv)
70 puts(hp->h_name); 71 puts(hp->h_name);
71 } else if (option_mask32 & OPT_s) { 72 } else if (option_mask32 & OPT_s) {
72 if (p != NULL) { 73 if (p != NULL) {
73 *p = 0; 74 *p = '\0';
74 } 75 }
75 puts(hp->h_name); 76 puts(hp->h_name);
76 } else if (option_mask32 & OPT_d) { 77 } else if (option_mask32 & OPT_d) {
@@ -84,7 +85,7 @@ int hostname_main(int argc, char **argv)
84 } 85 }
85 } 86 }
86 /* Set the hostname */ 87 /* Set the hostname */
87 else if (hostname_str != NULL) { 88 else if (option_mask32 & OPT_F) {
88 do_sethostname(hostname_str, 1); 89 do_sethostname(hostname_str, 1);
89 } else if (optind < argc) { 90 } else if (optind < argc) {
90 do_sethostname(argv[optind], 0); 91 do_sethostname(argv[optind], 0);