diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/sysdep.c | 16 | ||||
| -rw-r--r-- | src/terminfo.c | 4 |
2 files changed, 15 insertions, 5 deletions
diff --git a/src/sysdep.c b/src/sysdep.c index 8bde434f52d..63ffd28b5ba 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -230,7 +230,9 @@ static int baud_convert[] = | |||
| 230 | }; | 230 | }; |
| 231 | #endif | 231 | #endif |
| 232 | 232 | ||
| 233 | #ifdef HAVE_TERMIOS_H | 233 | #if defined (HAVE_TERMIOS_H) || defined (LINUX) |
| 234 | /* HJL's version of libc is said to need this on the Alpha. | ||
| 235 | On the other hand, DEC OSF1 on the Alpha needs ospeed to be a short. */ | ||
| 234 | extern speed_t ospeed; | 236 | extern speed_t ospeed; |
| 235 | #else | 237 | #else |
| 236 | extern short ospeed; | 238 | extern short ospeed; |
| @@ -2275,8 +2277,8 @@ init_system_name () | |||
| 2275 | 2277 | ||
| 2276 | for (;;) | 2278 | for (;;) |
| 2277 | { | 2279 | { |
| 2278 | char *fqdn = (char *) alloca (hostlen + 1 + domain_size); | 2280 | char *domain = (char *) alloca (domain_size + 1); |
| 2279 | char *domain = fqdn + hostlen + 1; | 2281 | char *fqdn = (char *) alloca (hostlen + 1 + domain_size + 1); |
| 2280 | #if HAVE_SYSINFO && defined (SI_SRPC_DOMAIN) | 2282 | #if HAVE_SYSINFO && defined (SI_SRPC_DOMAIN) |
| 2281 | int sys_domain_size = sysinfo (SI_SRPC_DOMAIN, domain, domain_size); | 2283 | int sys_domain_size = sysinfo (SI_SRPC_DOMAIN, domain, domain_size); |
| 2282 | if (sys_domain_size <= 0) | 2284 | if (sys_domain_size <= 0) |
| @@ -2304,7 +2306,13 @@ init_system_name () | |||
| 2304 | } | 2306 | } |
| 2305 | #endif /* HAVE_GETDOMAINNAME */ | 2307 | #endif /* HAVE_GETDOMAINNAME */ |
| 2306 | strcpy (fqdn, hostname); | 2308 | strcpy (fqdn, hostname); |
| 2307 | fqdn[hostlen] = '.'; | 2309 | if (domain[0] == '.') |
| 2310 | strcpy (fqdn + hostlen, domain); | ||
| 2311 | else | ||
| 2312 | { | ||
| 2313 | fqdn[hostlen] = '.'; | ||
| 2314 | strcpy (fqdn + hostlen + 1, domain); | ||
| 2315 | } | ||
| 2308 | hostname = fqdn; | 2316 | hostname = fqdn; |
| 2309 | break; | 2317 | break; |
| 2310 | } | 2318 | } |
diff --git a/src/terminfo.c b/src/terminfo.c index ab6ab9e4ccb..ae015b9b6ad 100644 --- a/src/terminfo.c +++ b/src/terminfo.c | |||
| @@ -26,8 +26,10 @@ Boston, MA 02111-1307, USA. */ | |||
| 26 | 26 | ||
| 27 | char *UP, *BC, PC; | 27 | char *UP, *BC, PC; |
| 28 | 28 | ||
| 29 | #ifdef HAVE_TERMIOS_H | 29 | #if defined (HAVE_TERMIOS_H) || defined (LINUX) |
| 30 | #include <termios.h> | 30 | #include <termios.h> |
| 31 | /* HJL's version of libc is said to need this on the Alpha. | ||
| 32 | On the other hand, DEC OSF1 on the Alpha needs ospeed to be a short. */ | ||
| 31 | speed_t ospeed; | 33 | speed_t ospeed; |
| 32 | #else | 34 | #else |
| 33 | short ospeed; | 35 | short ospeed; |