Bram > I'm not sure perror() can be used in general after system(). > Otherwise it makes sense. > Thanks. Indeed I only checked the documentation of
Visual Studio 2005 Visual Studio .NET Visual Studio 6.0 When making the patch. But by googling a little bit, I find firther indications that perror() could be used if system() returns .1: http://www.opengroup.org/onlinepubs/009695399/functions/system.html http://www.cplusplus.com/ref/cstdlib/system.html I could not explicitly find it in a manpage like http://www.fifi.org/cgi-bin/man2html/usr/share/man/man3/system.3.gz but here it is mentioned that a return value of -1 signifies an error -- so one can assume that in this case errno is set. But of course I didn't check my patch on every system. An alternative to my patch would be to set errno = 0 before calling system() and if system() returns -1 to check if errno has changed. With best regards Mathias
