From 354e6102a11f6ce2e39462c158b039a07f18ac7c Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 9 Jan 2001 01:04:59 +0000 Subject: Update. * time/Makefile (tests): Add tst-mktime. * time/tst-mktime.c: New file. * posix/tst-dir.c (main): One more mkdir() test. --- posix/tst-dir.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'posix/tst-dir.c') diff --git a/posix/tst-dir.c b/posix/tst-dir.c index 1eff3b5e06..74948af140 100644 --- a/posix/tst-dir.c +++ b/posix/tst-dir.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2000. @@ -518,6 +518,32 @@ main (int argc, char *argv[]) result = 1; } + /* One more test before we leave: mkdir() is supposed to fail with + EEXIST if the named file is a symlink. */ + if (symlink ("a-symlink", "a-symlink") != 0) + { + printf ("cannot create symlink \"a-symlink\": %m\n"); + result = 1; + } + else + { + if (mkdir ("a-symlink", 0666) == 0) + { + puts ("can make directory \"a-symlink\""); + result = 1; + } + else if (errno != EEXIST) + { + puts ("mkdir(\"a-symlink\") does not fail with EEXIST\n"); + result = 1; + } + if (unlink ("a-symlink") < 0) + { + printf ("cannot unlink \"a-symlink\": %m\n"); + result = 1; + } + } + if (chdir (srcdir) < 0) { printf ("cannot change back to source directory: %m\n"); -- cgit v1.2.3