X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-ptsname.c;h=921367cc1fb52c1d9bdf1ded32b88662d6ffeb8f;hb=09001dfb3ec39d237f8e248ff347cf1be3e6f0c1;hp=13596da1ffda968d6a187070b125ecf4d23933fd;hpb=168fc669c003eebe51fb61480d363f8a44695083;p=gnulib.git diff --git a/tests/test-ptsname.c b/tests/test-ptsname.c index 13596da1f..921367cc1 100644 --- a/tests/test-ptsname.c +++ b/tests/test-ptsname.c @@ -1,5 +1,5 @@ /* Test of ptsname(3). - Copyright (C) 2010 Free Software Foundation, Inc. + Copyright (C) 2010-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -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;