Gawk

Jerry LeVan MATLEVAN at EKU
Wed Feb 20 13:04:00 AEST 1991


Hello,

I have just built gawk-2.11 patch level 1. There appears to
be an annoying inconsistency with nawk running on SYS 5.3.

Consider the following program:
BEGIN{
        "ls -l foo" | getline
        print $0
        close("ls -l foo")
}

If the file foo is in the directory then the expected line
is printed. And the pipe is cleanly closed.

If the file foo is not in the current directory then getline
returns a zero (as it is supposed to), but the close ALWAYS
generates a warning message.

gawk: warning: failure status (512) on pipe close of "ls -l foo" (Error 0).
 source line number 4, file `gawktest'

In short,

If cmd does not write to stdout then "cmd | getline" will always
generate the above warning (messes up my reports!) when the pipe
is explicitly or implicitly closed. This behavior does not occur
on my AT&T machines. (5.3.2) (redirectly stderr gets rid of the
warning, but this also kills all other error handling.

Looking at the code (io.c) It turns out the the zero in (Error 0) is
the current value of errno, it is not clear to me where the 512 comes
from.

Any suggestions?

**********************************************************************
While installing gcc-1.39 I ran fixincludes and had problems,
Here is what happened:

# sh ./fixincludes
Making directories:
Making internal symbolic directory links
Finding header files in /usr/include:
Checking header files:
Fixing ./at/atlog.h
Deleting /usr/local/lib/gcc-include/./at/atlog.h; no fixes were needed.
Fixing ./sys/uinter.h
Fixing ./sys/fdioctl.h
Fixing ./sys/if_ae6.h
Deleting /usr/local/lib/gcc-include/./sys/if_ae6.h; no fixes were needed.
Fixing ./sys/mouse.h
Fixing ./sys/mtio.h
Fixing ./sys/ioctl.h
Fixing ./sys/pcl.h
Deleting /usr/local/lib/gcc-include/./sys/pcl.h; no fixes were needed.
Fixing ./sys/ssioctl.h
Fixing ./sys/stermio.h
Fixing ./sys/stropts.h
Fixing ./sys/ttychars.h
Fixing ./sys/sm_aux.h
Fixing ./sys/vcmd.h
Fixing ./stdio.h
Deleting /usr/local/lib/gcc-include/./stdio.h; no fixes were needed.
Fixing rpcsvc/rstat.h, definition of statsswtch
"/usr/local/lib/gcc-include/rpcsvc/rstat.h" 95 lines, 2088 characters
"/usr/local/lib/gcc-include/rpcsvc/rstat.h" 95 lines, 2088 characters
Deleting /usr/local/lib/gcc-include/rpcsvc/rstat.h; no fixes were needed.
Fixing sys/file.h, bad
"/usr/local/lib/gcc-include/sys/file.h" 143 lines, 4691 characters
Substitute pattern match failed
Deleting /usr/local/lib/gcc-include/sys/file.h; no fixes were needed.
./fixincludes: 1088 Memory fault - core dumped
Removing unneeded directories:
Making internal symbolic non-directory links

*************************************************************
Can anybody tell me what happened? Is it safe to gcc?

---Jerry
-----------------------------------------------------------------------------
| Jerry LeVan                           | Phone:(606)-622-1931              |
| Department of Computer Science        |                                   |
| Eastern Kentucky University           | Email:matlevan at eku.bitnet         |
| Richmond Ky 40475                     |                                   |
|---------------------------------------------------------------------------|
|      "The series converges so slowly that it actually diverges."          |
-----------------------------------------------------------------------------



More information about the Comp.unix.aux mailing list