BSD 4_4_Lite2 release
[unix-history] / usr / src / usr.bin / pascal / src / put.c
index edd2c46..240ec3a 100644 (file)
@@ -32,7 +32,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)put.c      8.1 (Berkeley) 6/6/93";
+static char sccsid[] = "@(#)put.c      8.2 (Berkeley) 5/24/94";
 #endif /* not lint */
 
 #include "whoami.h"
 #endif /* not lint */
 
 #include "whoami.h"
@@ -723,7 +723,6 @@ patchfil(loc, jmploc, words)
        int words;
 {
        register i;
        int words;
 {
        register i;
-       extern long lseek();
        short val;
 
        if ( !CGENNING )
        short val;
 
        if ( !CGENNING )
@@ -746,9 +745,12 @@ patchfil(loc, jmploc, words)
                if (i >= 0 && i < 1024) {
                        obuf[i] = val;
                } else {
                if (i >= 0 && i < 1024) {
                        obuf[i] = val;
                } else {
-                       (void) lseek(ofil, (long) loc+2, 0);
-                       write(ofil, (char *) (&val), 2);
-                       (void) lseek(ofil, (long) 0, 2);
+                       if (lseek(ofil, (off_t) loc+2, 0) == -1)
+                               perror("patchfil: lseek1"), panic("patchfil");
+                       if (write(ofil, (char *) (&val), 2) != 2)
+                               perror("patchfil: write"), panic("patchfil");
+                       if (lseek(ofil, (off_t) 0, 2) == -1)
+                               perror("patchfil: lseek2"), panic("patchfil");
                }
                loc += 2;
 #              ifdef DEC11
                }
                loc += 2;
 #              ifdef DEC11