aboutsummaryrefslogtreecommitdiff
path: root/tests/unistd
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-09-25 19:07:09 -0700
committerAlon Zakai <alonzakai@gmail.com>2011-09-25 19:07:09 -0700
commite965f257ccbab66f445a5157fdb538d99e8732dd (patch)
treea66719036197bcb90646905788bc17f04868312e /tests/unistd
parent62650456eb2a0618116dc443a52103f473ff332b (diff)
fix unistd_dup test
Diffstat (limited to 'tests/unistd')
-rw-r--r--tests/unistd/dup.c10
-rw-r--r--tests/unistd/dup.out10
2 files changed, 8 insertions, 12 deletions
diff --git a/tests/unistd/dup.c b/tests/unistd/dup.c
index 8b4dca34..7fae07eb 100644
--- a/tests/unistd/dup.c
+++ b/tests/unistd/dup.c
@@ -11,9 +11,8 @@ int main() {
f2 = open("/", O_RDONLY);
f3 = dup(f);
printf("errno: %d\n", errno);
- printf("f: %d\n", f);
- printf("f2: %d\n", f2);
- printf("f3: %d\n", f3);
+ printf("f: %d\n", f != f2 && f != f3);
+ printf("f2,f3: %d\n", f2 != f3);
printf("close(f1): %d\n", close(f));
printf("close(f2): %d\n", close(f2));
printf("close(f3): %d\n", close(f3));
@@ -25,9 +24,8 @@ int main() {
f2 = open("/", O_RDONLY);
f3 = dup2(f, f2);
printf("errno: %d\n", errno);
- printf("f: %d\n", f);
- printf("f2: %d\n", f2);
- printf("f3: %d\n", f3);
+ printf("f: %d\n", f != f2 && f != f3);
+ printf("f2,f3: %d\n", f2 == f3);
printf("close(f1): %d\n", close(f));
printf("close(f2): %d\n", close(f2));
printf("close(f3): %d\n", close(f3));
diff --git a/tests/unistd/dup.out b/tests/unistd/dup.out
index da95157d..0b258ba3 100644
--- a/tests/unistd/dup.out
+++ b/tests/unistd/dup.out
@@ -1,17 +1,15 @@
DUP
errno: 0
-f: 4
-f2: 5
-f3: 6
+f: 1
+f2,f3: 1
close(f1): 0
close(f2): 0
close(f3): 0
DUP2
errno: 0
-f: 7
-f2: 8
-f3: 8
+f: 1
+f2,f3: 1
close(f1): 0
close(f2): 0
close(f3): -1