Steffen Nurpmeso <[email protected]> wrote:
> |$ bash ../mk/make-rules.sh su/*.c
> |(...previous lines omitted...)
> |su-018.o: $(SU_SRCDIR)su/utf.cawk: su/utf.c makes too many open files
> | input record number 18, file
> | source line number 74
>
> Ah! Of course, i had totally forgotten about this! The Apple awk
> leaks file descriptors,
Maybe rather your *script* is leaking the file descriptors. I see you
are are merrily opening new files through
po_i = getline < farr[no]
without ever closing them again, so they accumulate.
I suggest to add the close into the EOF check following right after
the getline:
if(po_i == 0) {
close(farr[no]
break
}
(I grew up on unix systems with the "20 open files per process" limit,
so I quickly got into the habit of properly closing my files again
in awk, too.)
Martin