X-Git-Url: https://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-file-has-acl.c;h=5685f41155f56a2160ec16af5569270d19665f6a;hb=9cedf3e1ac7dbdddefb7e172156e9000de7d80c2;hp=daab4dbd9fc2e88461ac80fc80514ad409f32a39;hpb=456355401219fdc2cb203baedd2bf176572e8310;p=gnulib.git diff --git a/tests/test-file-has-acl.c b/tests/test-file-has-acl.c index daab4dbd9..5685f4115 100644 --- a/tests/test-file-has-acl.c +++ b/tests/test-file-has-acl.c @@ -1,5 +1,5 @@ /* Test for presence of ACL. - Copyright (C) 2008 Free Software Foundation, Inc. + Copyright (C) 2008-2009 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 @@ -20,6 +20,7 @@ #include "acl.h" +#include #include #include #include @@ -54,6 +55,14 @@ main (int argc, char *argv[]) exit (EXIT_FAILURE); } + /* Check against possible infinite loop in file_has_acl. */ +#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 + #if USE_ACL { int ret = file_has_acl (file, &statbuf);