summaryrefslogtreecommitdiff
path: root/posix/tst-dir.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-01-09 01:04:59 +0000
committerUlrich Drepper <drepper@redhat.com>2001-01-09 01:04:59 +0000
commit354e6102a11f6ce2e39462c158b039a07f18ac7c (patch)
treed0b61e9e76e22cfea34f764e090d8a659ae45380 /posix/tst-dir.c
parentf93e323f9e627ae8403ad2fc64663793153bf7ec (diff)
downloadglibc-354e6102a11f6ce2e39462c158b039a07f18ac7c.tar.gz
Update.
* time/Makefile (tests): Add tst-mktime. * time/tst-mktime.c: New file. * posix/tst-dir.c (main): One more mkdir() test.
Diffstat (limited to 'posix/tst-dir.c')
-rw-r--r--posix/tst-dir.c28
1 files changed, 27 insertions, 1 deletions
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 <drepper@redhat.com>, 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");