diff options
Diffstat (limited to 'networking/hostname.c')
-rw-r--r-- | networking/hostname.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/networking/hostname.c b/networking/hostname.c index 4b305d2b6..d87f6562f 100644 --- a/networking/hostname.c +++ b/networking/hostname.c | |||
@@ -22,9 +22,9 @@ | |||
22 | //config: help | 22 | //config: help |
23 | //config: Alias to "hostname -d". | 23 | //config: Alias to "hostname -d". |
24 | 24 | ||
25 | // APPLET_ODDNAME:name main location suid_type help | 25 | // APPLET_NOEXEC:name main location suid_type help |
26 | //applet:IF_DNSDOMAINNAME(APPLET_ODDNAME(dnsdomainname, hostname, BB_DIR_BIN, BB_SUID_DROP, dnsdomainname)) | 26 | //applet:IF_DNSDOMAINNAME(APPLET_NOEXEC(dnsdomainname, hostname, BB_DIR_BIN, BB_SUID_DROP, dnsdomainname)) |
27 | //applet:IF_HOSTNAME(APPLET(hostname, BB_DIR_BIN, BB_SUID_DROP)) | 27 | //applet:IF_HOSTNAME( APPLET_NOEXEC(hostname, hostname, BB_DIR_BIN, BB_SUID_DROP, hostname )) |
28 | 28 | ||
29 | //kbuild: lib-$(CONFIG_HOSTNAME) += hostname.o | 29 | //kbuild: lib-$(CONFIG_HOSTNAME) += hostname.o |
30 | //kbuild: lib-$(CONFIG_DNSDOMAINNAME) += hostname.o | 30 | //kbuild: lib-$(CONFIG_DNSDOMAINNAME) += hostname.o |
@@ -114,7 +114,7 @@ static void do_sethostname(char *s, int isfile) | |||
114 | * { bbox: not supported } | 114 | * { bbox: not supported } |
115 | * -F, --file filename | 115 | * -F, --file filename |
116 | * Read the host name from the specified file. Comments (lines | 116 | * Read the host name from the specified file. Comments (lines |
117 | * starting with a `#') are ignored. | 117 | * starting with a '#') are ignored. |
118 | */ | 118 | */ |
119 | int hostname_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 119 | int hostname_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
120 | int hostname_main(int argc UNUSED_PARAM, char **argv) | 120 | int hostname_main(int argc UNUSED_PARAM, char **argv) |
@@ -132,8 +132,9 @@ int hostname_main(int argc UNUSED_PARAM, char **argv) | |||
132 | char *buf; | 132 | char *buf; |
133 | char *hostname_str; | 133 | char *hostname_str; |
134 | 134 | ||
135 | #if ENABLE_LONG_OPTS | 135 | /* dnsdomainname from net-tools 1.60, hostname 1.100 (2001-04-14), |
136 | applet_long_options = | 136 | * supports hostname's options too (not just -v as manpage says) */ |
137 | opts = getopt32(argv, "dfisF:v", &hostname_str, | ||
137 | "domain\0" No_argument "d" | 138 | "domain\0" No_argument "d" |
138 | "fqdn\0" No_argument "f" | 139 | "fqdn\0" No_argument "f" |
139 | //Enable if seen in active use in some distro: | 140 | //Enable if seen in active use in some distro: |
@@ -142,12 +143,7 @@ int hostname_main(int argc UNUSED_PARAM, char **argv) | |||
142 | // "short\0" No_argument "s" | 143 | // "short\0" No_argument "s" |
143 | // "verbose\0" No_argument "v" | 144 | // "verbose\0" No_argument "v" |
144 | "file\0" No_argument "F" | 145 | "file\0" No_argument "F" |
145 | ; | 146 | ); |
146 | |||
147 | #endif | ||
148 | /* dnsdomainname from net-tools 1.60, hostname 1.100 (2001-04-14), | ||
149 | * supports hostname's options too (not just -v as manpage says) */ | ||
150 | opts = getopt32(argv, "dfisF:v", &hostname_str); | ||
151 | argv += optind; | 147 | argv += optind; |
152 | buf = safe_gethostname(); | 148 | buf = safe_gethostname(); |
153 | if (ENABLE_DNSDOMAINNAME) { | 149 | if (ENABLE_DNSDOMAINNAME) { |