summaryrefslogtreecommitdiffstats
path: root/bin/hostname/hostname.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/hostname/hostname.c')
-rw-r--r--bin/hostname/hostname.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/hostname/hostname.c b/bin/hostname/hostname.c
index 512327b..dd3f7e9 100644
--- a/bin/hostname/hostname.c
+++ b/bin/hostname/hostname.c
@@ -58,8 +58,13 @@ main(int argc, char *argv[])
char *p, hostname[MAXHOSTNAMELEN];
sflag = 0;
- while ((ch = getopt(argc, argv, "s")) != -1)
+ while ((ch = getopt(argc, argv, "sf")) != -1)
switch (ch) {
+ case 'f':
+ /* On Linux, "hostname -f" prints FQDN. */
+ /* BSD "hostname" always print FQDN by
+ * default, so we accept but ignore -f. */
+ break;
case 's':
sflag = 1;
break;
OpenPOWER on IntegriCloud