summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-07-07 06:48:01 +0000
committerRichard M. Stallman <rms@gnu.org>1997-07-07 06:48:01 +0000
commit825e7e55bec78430867e824a4101009ca8129869 (patch)
tree7762116994636be31ea83df871ab616a95854680
parent0dc57298fdc0760d8c69dcbcb940145f77022f5d (diff)
downloademacs-825e7e55bec78430867e824a4101009ca8129869.tar.gz
(ospeed): Define as short, unless HAVE_TERMIOS_H and LINUX.
-rw-r--r--src/sysdep.c16
-rw-r--r--src/terminfo.c4
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[] =
};
#endif
-#ifdef HAVE_TERMIOS_H
+#if defined (HAVE_TERMIOS_H) || defined (LINUX)
+/* HJL's version of libc is said to need this on the Alpha.
+ On the other hand, DEC OSF1 on the Alpha needs ospeed to be a short. */
extern speed_t ospeed;
#else
extern short ospeed;
@@ -2275,8 +2277,8 @@ init_system_name ()
for (;;)
{
- char *fqdn = (char *) alloca (hostlen + 1 + domain_size);
- char *domain = fqdn + hostlen + 1;
+ char *domain = (char *) alloca (domain_size + 1);
+ char *fqdn = (char *) alloca (hostlen + 1 + domain_size + 1);
#if HAVE_SYSINFO && defined (SI_SRPC_DOMAIN)
int sys_domain_size = sysinfo (SI_SRPC_DOMAIN, domain, domain_size);
if (sys_domain_size <= 0)
@@ -2304,7 +2306,13 @@ init_system_name ()
}
#endif /* HAVE_GETDOMAINNAME */
strcpy (fqdn, hostname);
- fqdn[hostlen] = '.';
+ if (domain[0] == '.')
+ strcpy (fqdn + hostlen, domain);
+ else
+ {
+ fqdn[hostlen] = '.';
+ strcpy (fqdn + hostlen + 1, domain);
+ }
hostname = fqdn;
break;
}
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. */
char *UP, *BC, PC;
-#ifdef HAVE_TERMIOS_H
+#if defined (HAVE_TERMIOS_H) || defined (LINUX)
#include <termios.h>
+/* HJL's version of libc is said to need this on the Alpha.
+ On the other hand, DEC OSF1 on the Alpha needs ospeed to be a short. */
speed_t ospeed;
#else
short ospeed;