/* This call crashes before the fix for bz22786 on 32-bit platforms. */
p = realpath (path, NULL);
-
- if (p != NULL || errno != ENAMETOOLONG)
- {
- printf ("realpath: %s (%m)", p);
- return EXIT_FAILURE;
- }
+ TEST_VERIFY (p == NULL);
+ /* For 64-bit platforms readlink return ENAMETOOLONG, while for 32-bit
+ realpath will try to allocate a buffer larger than PTRDIFF_MAX. */
+ TEST_VERIFY (errno == ENOMEM || errno == ENAMETOOLONG);
/* Cleanup. */
unlink (lnk);
return 0;
}
-#define TEST_FUNCTION do_test
#include <support/test-driver.c>