diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2002-02-08 17:09:25 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2002-02-08 17:09:25 +0000 |
commit | fc54576be033828908c98695b5126448220b34ab (patch) | |
tree | 346bbd87c967fbe03dcb45a4298ddefc2526a370 /regress/sys/kern | |
parent | fd17255120c171497dd24dc296aba3364f7a5a2e (diff) |
Check that we get the right errno.
Diffstat (limited to 'regress/sys/kern')
-rw-r--r-- | regress/sys/kern/rlimit-file/rlim-file.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/regress/sys/kern/rlimit-file/rlim-file.c b/regress/sys/kern/rlimit-file/rlim-file.c index 183c2b64966..1d817f7050e 100644 --- a/regress/sys/kern/rlimit-file/rlim-file.c +++ b/regress/sys/kern/rlimit-file/rlim-file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rlim-file.c,v 1.1 2002/02/05 16:19:49 art Exp $ */ +/* $OpenBSD: rlim-file.c,v 1.2 2002/02/08 17:09:24 art Exp $ */ /* * Written by Artur Grabowski <art@openbsd.org> (2002) Public Domain. */ @@ -8,6 +8,8 @@ #include <err.h> #include <unistd.h> #include <fcntl.h> +#include <errno.h> +#include <string.h> int main() @@ -28,6 +30,12 @@ main() if (pipe(fds) == 0) errx(1, "pipe was allowed"); + if (errno == ENFILE) + errx(1, "try to do the test on a less loaded system"); + + if (errno != EMFILE) + errx(1, "bad errno (%d): %s", errno, strerror(errno)); + return 0; } |