summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-05-08 11:31:34 -0700
committerKarolin Seeger <kseeger@samba.org>2009-06-10 16:17:52 +0200
commit5a40f4b0f63bb756f75690c6f2dc28b46bc1029d (patch)
tree12357b03464862696e4e4fab8b100c85af0ae891 /tests
parent3feda0e3b42d7f1314d167286d570e54c15f408e (diff)
downloadsamba-5a40f4b0f63bb756f75690c6f2dc28b46bc1029d.tar.gz
samba-5a40f4b0f63bb756f75690c6f2dc28b46bc1029d.tar.xz
samba-5a40f4b0f63bb756f75690c6f2dc28b46bc1029d.zip
Fix bug #6330 - DFS doesn't work on AIX. Jeremy.
This was commit 3d6f4a7af in master. (cherry picked from commit c66b3807a356655d1d4e351502cad939f4d1d101)
Diffstat (limited to 'tests')
-rw-r--r--tests/readlink.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/readlink.c b/tests/readlink.c
new file mode 100644
index 00000000000..a07e62aa754
--- /dev/null
+++ b/tests/readlink.c
@@ -0,0 +1,33 @@
+/* test whether readlink returns a short buffer correctly. */
+
+#if defined(HAVE_UNISTD_H)
+#include <unistd.h>
+#endif
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#define DATA "readlink.test"
+#define FNAME "rdlnk.file"
+
+main()
+{
+ int buf[7];
+ int ret;
+ ssize_t rl_ret;
+
+ unlink(FNAME);
+ ret = symlink(DATA, FNAME);
+ if (ret == -1) {
+ exit(1);
+ }
+
+ rl_ret = readlink(FNAME, buf, sizeof(buf));
+ if (rl_ret == -1) {
+ unlink(FNAME);
+ exit(1);
+ }
+ unlink(FNAME);
+ exit(0);
+}