summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7f543cd)
raw | patch | inline | side by side (parent: 7f543cd)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 15 Jan 2010 06:57:18 +0000 (06:57 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 15 Jan 2010 06:57:18 +0000 (06:57 +0000) |
m4/acinclude.m4 | patch | blob | history |
diff --git a/m4/acinclude.m4 b/m4/acinclude.m4
index 01eb4a41314c13686b811b4e332240c256a99dcc..ee2fc1b97ca466123b3450081c07939996269c6a 100644 (file)
--- a/m4/acinclude.m4
+++ b/m4/acinclude.m4
#include <sys/mman.h>
#include <stdlib.h>
#include <utime.h>
+#include <signal.h>
+void timeout (int i) { exit (1); }
int main(void){
int fd;
struct stat stbuf;
int res;
char temp[] = "mmaptestXXXXXX";
struct utimbuf newtime;
-
time_t create_ts;
fd = mkstemp(temp);
if (fd == -1){
perror("close");
goto bad_exit;
}
+ /* there were reports of sync hanging
+ so we better set an alarm */
+ signal(SIGALRM,&timeout);
+ alarm(5);
/* The ASYNC means that we schedule the msync and return immediately.
Since we want to see if the modification time is updated upon
msync(), we have to make sure that our asynchronous request
completes before we stat below. In a real application, the
request would be completed at a random time in the future
but for this test we do not want to wait an arbitrary amount of
- time, so force a commit now. */
+ time, so force a commit now. */
sync();
stat(temp, &stbuf);
if (create_ts > stbuf.st_mtime){