24 Jun 2012 14:56
ptsname test
Bruno Haible <bruno <at> clisp.org>
2012-06-24 12:56:34 GMT
2012-06-24 12:56:34 GMT
On all platforms, ptsname() sets errno when the argument is an invalid file descriptor. Even through POSIX does not require it [1], it's safe to check it. [1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/ptsname.html 2012-06-24 Bruno Haible <bruno <at> clisp.org> ptsname test: Extend test. * tests/test-ptsname.c: Include <errno.h>. (main): Test behaviour with invalid file descriptor. --- tests/test-ptsname.c.orig Sun Jun 24 14:51:29 2012 +++ tests/test-ptsname.c Sun Jun 24 14:42:35 2012 <at> <at> -21,6 +21,7 <at> <at> #include "signature.h" SIGNATURE_CHECK (ptsname, char *, (int)); +#include <errno.h> #include <fcntl.h> #include <signal.h> #include <stdio.h> <at> <at> -63,6 +64,17 <at> <at> #endif { + char *result; + + errno = 0; + result = ptsname (-1);(Continue reading)
RSS Feed