On Sat, 10 Sep 2022 18:45:04 -0500, Charles Mills wrote:
> ...
> ... the first file works (and the second file works if it is first).
>
On Sun, 11 Sep 2022 11:29:07 -0500, Charles Mills wrote:
>Thank you all and especially @Bernd Oppolzer. They key is that I was not
>checking the open for success correctly. I was formatting the second file name
>incorrectly and as a result the open was failing but my code did not make me
>aware of that. Bad open of course yields a bad fd which yields a -21. It is
>all new code and I had not tested open failures specifically.
>
Why does it always fail on the second file regardless of swapping the order?
I'll suggest defending against perverse file names by replacing:
"open" Arg(1) O_RDONLY
with:
FN = Arg(1)
"open (FN)" O_RDONLY
That should make -21 impossible.
--
gil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN