The relevant part of popen(3) looks like this and doesn't say anything errno during pclose() failure. > The popen() function returns NULL if the fork(2) or pipe(2) calls fail, > or if it cannot allocate memory. > > The pclose() function returns -1 if stream is not associated with a > “popened” command, if stream already “pclosed”, or if wait4(2) returns an > error. > > ERRORS > The popen() function does not reliably set errno.
It says "The popen() function does not reliably set errno." Do you mean something else?
Not sure now.