changeset 525:44213fc1fbb6

*** empty log message ***
author Jim Blandy <jimb@redhat.com>
date Fri, 31 Jan 1992 21:29:35 +0000
parents 79ea818b6aed
children a41500eed1c5
files src/m/intel386.h src/m/iris4d.h src/s/usg5-4.h src/sysdep.c
diffstat 4 files changed, 51 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/src/m/intel386.h	Fri Jan 31 21:19:17 1992 +0000
+++ b/src/m/intel386.h	Fri Jan 31 21:29:35 1992 +0000
@@ -1,4 +1,4 @@
-/* machine description file for intel 386.
+/* Machine description file for intel 386.
    Copyright (C) 1987 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -100,7 +100,7 @@
 #define LOAD_AVE_TYPE short
 
 /* Convert that into an integer that is 100 for a load average of 1.0  */
-#define LOAD_AVE_CVT(x) ((int) (((double) (x)) * 100.0 / FSCALE))
+#define LOAD_AVE_CVT(x) (((double) (x)) * 100.0 / FSCALE)
   
 #define FSCALE 256.0         /* determined by experimentation...  */
 #endif
@@ -113,9 +113,9 @@
 /* Convert that into an integer that is 100 for a load average of 1.0  */
 /* This is totally uncalibrated. */
 
-#define LOAD_AVE_CVT(x) ((int) ((double) (x)) * 100.0 / FSCALE)
+#define LOAD_AVE_CVT(x) ((int) (((double) (x)) * 100.0 / FSCALE))
 #define FSCALE 256.0
-*endif
+#endif
 
 /* Define CANNOT_DUMP on machines where unexec does not work.
    Then the function dump-emacs will not be defined
@@ -160,7 +160,9 @@
 #else /* not XENIX */
 
 #ifdef USG
+#ifndef LIB_STANDARD
 #define LIB_STANDARD -lPW -lc
+#endif
 #define HAVE_ALLOCA
 #define NO_REMAP 
 #define TEXT_START 0
@@ -170,7 +172,6 @@
 #ifdef BSD
 #define HAVE_ALLOCA
 #endif /* BSD */
- BSD */
 
 /* If compiling with GCC, let GCC implement alloca.  */
 #if defined(__GNUC__) && !defined(alloca)
@@ -178,5 +179,15 @@
 #define HAVE_ALLOCA
 #endif
 
-/* Search these directories just in case; I'm told they might be needed.  */
-#define C_SWITCH_MACHINE  -I/usr/X/include -I/usr/netinclude
+#ifdef USG
+#ifdef __STDC__
+#ifndef DONT_DEFINE_SIGNAL
+/* Cast the function argument to avoid warnings.  */
+#define signal(sig, func) (signal (sig, (void (*) (int)) (func)))
+#endif
+#endif
+#endif
+
+#ifdef USG5_4
+#define DATA_SEG_BITS 0x08000000
+#endif
--- a/src/m/iris4d.h	Fri Jan 31 21:19:17 1992 +0000
+++ b/src/m/iris4d.h	Fri Jan 31 21:29:35 1992 +0000
@@ -191,3 +191,7 @@
 #define XMARKBIT(a) ((a) < 0)
 #define XSETMARKBIT(a,b) ((a) = ((a) & ~MARKBIT) | ((b) ? MARKBIT : 0))
 #define XUNMARK(a) ((a) = (((unsigned)(a) << INTBITS-GCTYPEBITS-VALBITS) >> INTBITS-GCTYPEBITS-VALBITS))
+
+/* Turn off some "helpful" error checks for type mismatches
+   that we can't fix without breaking other machines.  */
+#define C_SWITCH_MACHINE -cckr
--- a/src/s/usg5-4.h	Fri Jan 31 21:19:17 1992 +0000
+++ b/src/s/usg5-4.h	Fri Jan 31 21:29:35 1992 +0000
@@ -45,8 +45,6 @@
 
 #define LIB_STANDARD GNULIB -lsocket -lnsl -lelf -lc /usr/ucblib/libucb.a /usr/ccs/lib/crtn.o
 
-#define DATA_SEG_BITS 0x08000000
-
 /* Use ptem.h to get structures related to windows.  */
 
 #define NEED_PTEM_H
--- a/src/sysdep.c	Fri Jan 31 21:19:17 1992 +0000
+++ b/src/sysdep.c	Fri Jan 31 21:29:35 1992 +0000
@@ -3257,19 +3257,38 @@
 {
   register char *p;
   register char *e;
-  int retval, sum;
+  int sum = 0;
+  struct stat st;
+
+  fstat (fildes, &st);
   p = buf;
-  sum = 0;
   while (nbytes > 0)
     {
-      e =  p + min (MAXIOSIZE, nbytes) - 1;
-      while (*e != '\n' && e > p) e--;
-      if (p == e)		/* Ok.. so here we add a newline... sigh. */
-	e = p + min (MAXIOSIZE, nbytes) - 1;
-      retval = write (fildes, p, e - p + 1);
-      if (retval != e - p + 1) return -1;
-      p = e + 1;
-      sum = sum + retval;
+      int len, retval;
+
+      /* Handle fixed-length files with carriage control.  */
+      if (st.st_fab_rfm == FAB$C_FIX
+	  && ((st.st_fab_rat & (FAB$M_FTN | FAB$M_CR)) != 0))
+	{
+	  len = st.st_fab_mrs;
+	  retval = write (fildes, p, min (len, nbytes));
+	  if (retval != len)
+	    return -1;
+	  retval++;	/* This skips the implied carriage control */
+	}
+      else
+	{
+	  e =  p + min (MAXIOSIZE, nbytes) - 1;
+	  while (*e != '\n' && e > p) e--;
+	  if (p == e)		/* Ok.. so here we add a newline... sigh. */
+	    e = p + min (MAXIOSIZE, nbytes) - 1;
+	  len = e + 1 - p;
+	  retval = write (fildes, p, len);
+	  if (retval != len)
+	    return -1;
+	}
+      p += retval;
+      sum += retval;
       nbytes -= retval;
     }
   return sum;