From 515d041153e488c6b73df343a3a329d942990133 Mon Sep 17 00:00:00 2001 From: jD91mZM2 Date: Sat, 14 Jul 2018 19:52:02 +0200 Subject: [PATCH] Hehe make environment tests work for everybody --- tests/env.c | 8 ++++---- tests/expected/env.stdout | 4 +--- tests/pipe.c | 7 ------- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/tests/env.c b/tests/env.c index 73b39154ad..a6b2ea0f30 100644 --- a/tests/env.c +++ b/tests/env.c @@ -2,10 +2,10 @@ #include int main() { - puts(getenv("SHELL")); - puts(getenv("CC")); + //puts(getenv("SHELL")); + //puts(getenv("CC")); - putenv("KEK=lol"); + putenv("TEST=It's working!!"); - puts(getenv("KEK")); + puts(getenv("TEST")); } diff --git a/tests/expected/env.stdout b/tests/expected/env.stdout index d0ec8ca5bb..a0c71315b9 100644 --- a/tests/expected/env.stdout +++ b/tests/expected/env.stdout @@ -1,3 +1 @@ -/nix/store/zqh3l3lyw32q1ayb15bnvg9f24j5v2p0-bash-4.4-p12/bin/bash -gcc -lol +It's working!! diff --git a/tests/pipe.c b/tests/pipe.c index fbbc72ea9f..703073cc35 100644 --- a/tests/pipe.c +++ b/tests/pipe.c @@ -1,5 +1,4 @@ //http://www2.cs.uregina.ca/~hamilton/courses/330/notes/unix/pipes/pipes.html -#include #include #include @@ -15,25 +14,19 @@ int main() pid = fork(); if (pid == 0) /* child : sends message to parent*/ { - puts("Child: Close Read"); /* close read end */ close(pip[0]); - puts("Child: Write"); /* send 7 characters in the string, including end-of-string */ write(pip[1], outstring, strlen(outstring)); - puts("Child: Close Write"); /* close write end */ close(pip[1]); } else /* parent : receives message from child */ { - puts("Parent: Close Write"); /* close write end */ close(pip[1]); - puts("Parent: Read"); /* read from the pipe */ read(pip[0], instring, 7); - puts("Parent: Close Read"); /* close read end */ close(pip[0]); }