From 37806f79cd612ab390e277ae4b1afac86413e979 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 2 Oct 2006 08:56:35 +0000 Subject: r19029: test if opendir() on a file sets errno = ENOTDIR metze (This used to be commit 6b5f06b059583f9d685d71d48299ab334581c179) --- source4/lib/replace/test/os2_delete.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source4/lib/replace/test/os2_delete.c b/source4/lib/replace/test/os2_delete.c index d0aadb24ba..8501e0bb40 100644 --- a/source4/lib/replace/test/os2_delete.c +++ b/source4/lib/replace/test/os2_delete.c @@ -21,7 +21,7 @@ static int test_readdir_os2_delete_ret; -#define FAILED(d) (fprintf(stderr, "Failed for %s - %s\n", d, strerror(errno)), test_readdir_os2_delete_ret = 1, 1) +#define FAILED(d) (fprintf(stderr, "Failed for %s - %d = %s\n", d, errno, strerror(errno)), test_readdir_os2_delete_ret = 1, 1) #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) @@ -87,7 +87,11 @@ int test_readdir_os2_delete(void) cleanup(); create_files(); - + + d = opendir(TESTDIR "/test0.txt"); + if (d != NULL) FAILED("opendir() on file succeed"); + if (errno != ENOTDIR) FAILED("opendir() on file didn't give ENOTDIR"); + d = opendir(TESTDIR); /* skip past . and .. */ -- cgit