last few day's work
[unix-history] / usr / src / usr.bin / pascal / libpc / WRITEC.c
index 3451361..9bcc71d 100644 (file)
@@ -1,22 +1,23 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)WRITEC.c 1.1 %G%";
+static char sccsid[] = "@(#)WRITEC.c 1.4 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 WRITEC(curfile, d1, d2)
 
        register struct iorec   *curfile;
 
 WRITEC(curfile, d1, d2)
 
        register struct iorec   *curfile;
-       int                     d1, d2;
+       char                    d1;
+       FILE                    *d2;
 {
        if (curfile->funit & FREAD) {
 {
        if (curfile->funit & FREAD) {
-               ERROR(EWRITEIT, curfile->pfname);
+               ERROR("%s: Attempt to write, but open for reading\n",
+                       curfile->pfname);
                return;
        }
        fputc(d1, d2);
        if (ferror(curfile->fbuf)) {
                return;
        }
        fputc(d1, d2);
        if (ferror(curfile->fbuf)) {
-               ERROR(EWRITE, curfile->pfname);
+               PERROR("Could not write to ", curfile->pfname);
                return;
        }
 }
                return;
        }
 }