added test for return val of nowwriting(). DLW
authorDavid Wasley <dlw@ucbvax.Berkeley.EDU>
Wed, 12 Aug 1981 10:42:58 +0000 (02:42 -0800)
committerDavid Wasley <dlw@ucbvax.Berkeley.EDU>
Wed, 12 Aug 1981 10:42:58 +0000 (02:42 -0800)
SCCS-vsn: usr.bin/f77/libU77/putc_.c 1.3
SCCS-vsn: usr.bin/f77/libU77/fputc_.c 1.4

usr/src/usr.bin/f77/libU77/fputc_.c
usr/src/usr.bin/f77/libU77/putc_.c

index 0c94b03..6d212b1 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
-char id_fputc[] = @(#)fputc_.c 1.3";
+char id_fputc[] = @(#)fputc_.c 1.4";
  *
  * write a character to a logical unit bypassing formatted I/O
  *
  *
  * write a character to a logical unit bypassing formatted I/O
  *
@@ -27,8 +27,8 @@ long *u; char *c; long clen;
        lu = &units[*u];
        if (!lu->ufd)
                return((long)(errno=F_ERNOPEN));
        lu = &units[*u];
        if (!lu->ufd)
                return((long)(errno=F_ERNOPEN));
-       if (!lu->uwrt)
-               nowwriting(lu);
+       if (!lu->uwrt && ! nowwriting(lu))
+               return((long)errno);
        putc (*c, lu->ufd);
        if (ferror(lu->ufd))
        {
        putc (*c, lu->ufd);
        if (ferror(lu->ufd))
        {
index 853a2ea..261f09f 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
-char id_putc[] = "@(#)putc_.c  1.2";
+char id_putc[] = "@(#)putc_.c  1.3";
  *
  * write a character to the standard output
  *
  *
  * write a character to the standard output
  *
@@ -25,8 +25,8 @@ char *c; long clen;
        lu = &units[STDOUT];
        if (!lu->ufd)
                return((long)(errno=F_ERNOPEN));
        lu = &units[STDOUT];
        if (!lu->ufd)
                return((long)(errno=F_ERNOPEN));
-       if (!lu->uwrt)
-               nowwriting(lu);
+       if (!lu->uwrt && ! nowwriting(lu))
+               return((long)errno);
        putc (*c, lu->ufd);
        if (ferror(lu->ufd))
        {
        putc (*c, lu->ufd);
        if (ferror(lu->ufd))
        {