diff options
author | Sascha Schumann <sas@php.net> | 2002-10-02 08:32:26 +0000 |
---|---|---|
committer | Sascha Schumann <sas@php.net> | 2002-10-02 08:32:26 +0000 |
commit | 66833340662ec055592b9cca3a23825fa619da8e (patch) | |
tree | c459a69994c96e7ed62c73d0d34e01dcae6012eb | |
parent | 875c1da58ed3ddcf9919a8da09d127ae965abd91 (diff) | |
download | php-git-66833340662ec055592b9cca3a23825fa619da8e.tar.gz |
Another Linux x86 system returns ELIMIT so we need to check errno as well
before assuming that pread/pwrite work.
-rw-r--r-- | acinclude.m4 | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index 3926bd08bf..7f8f57a181 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -380,6 +380,7 @@ AC_DEFUN(PHP_DOES_PWRITE_WORK,[ #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> +#include <errno.h> $1 main() { int fd = open("conftest_in", O_WRONLY|O_CREAT, 0600); @@ -387,7 +388,7 @@ $1 if (fd < 0) exit(1); if (pwrite(fd, "text", 4, 0) != 4) exit(1); /* Linux glibc breakage until 2.2.5 */ - if (pwrite(fd, "text", 4, -1) != -1) exit(1); + if (pwrite(fd, "text", 4, -1) != -1 || errno != EINVAL) exit(1); exit(0); } @@ -407,6 +408,7 @@ AC_DEFUN(PHP_DOES_PREAD_WORK,[ #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> +#include <errno.h> $1 main() { char buf[3]; @@ -414,7 +416,7 @@ $1 if (fd < 0) exit(1); if (pread(fd, buf, 2, 0) != 2) exit(1); /* Linux glibc breakage until 2.2.5 */ - if (pread(fd, buf, 2, -1) != -1) exit(1); + if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) exit(1); exit(0); } ],[ |