X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-ptsname.c;h=921367cc1fb52c1d9bdf1ded32b88662d6ffeb8f;hb=09001dfb3ec39d237f8e248ff347cf1be3e6f0c1;hp=ccf2ab1b5e265e3925c692f86196eaa9009f0301;hpb=d60f3b0c6b0f93a601acd1cfd3923f94ca05abb0;p=gnulib.git diff --git a/tests/test-ptsname.c b/tests/test-ptsname.c index ccf2ab1b5..921367cc1 100644 --- a/tests/test-ptsname.c +++ b/tests/test-ptsname.c @@ -22,6 +22,7 @@ SIGNATURE_CHECK (ptsname, char *, (int)); #include +#include #include #include #include @@ -54,6 +55,13 @@ same_slave (const char *slave_name1, const char *slave_name2) int main (void) { +#if HAVE_DECL_ALARM + /* Declare failure if test takes too long, by using default abort + caused by SIGALRM. */ + signal (SIGALRM, SIG_DFL); + alarm (5); +#endif + { int fd; char *result;