aboutsummaryrefslogtreecommitdiffstats
path: root/src/sysdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sysdep.c')
-rw-r--r--src/sysdep.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/sysdep.c b/src/sysdep.c
index 55f4d57da1b..bdac188ed64 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1895,6 +1895,16 @@ get_system_name ()
1895 hp = gethostbyname (system_name_saved); 1895 hp = gethostbyname (system_name_saved);
1896 if (hp && strlen (hp->h_name) < sizeof(system_name_saved)) 1896 if (hp && strlen (hp->h_name) < sizeof(system_name_saved))
1897 strcpy (system_name_saved, hp->h_name); 1897 strcpy (system_name_saved, hp->h_name);
1898 if (hp && !index (system_name_saved, '.'))
1899 {
1900 /* We still don't have a fully qualified domain name.
1901 Try to find one in the list of alternate names */
1902 char **alias = hp->h_aliases;
1903 while (*alias && !index (*alias, '.'))
1904 alias++;
1905 if (*alias && strlen (*alias) < sizeof (system_name_saved))
1906 strcpy (system_name_saved, *alias);
1907 }
1898 } 1908 }
1899#endif /* HAVE_SOCKETS */ 1909#endif /* HAVE_SOCKETS */
1900#endif /* not VMS */ 1910#endif /* not VMS */