gatteur

simple program for gating TCP connection
git clone git://git.kocotian.pl/gatteur.git
Log | Files | Refs | README | LICENSE

commit e93004106722000f8b3ffa76e21d8326017bc6c0
parent 834033de685f4a78c8718c1698ea77be2aaef85b
Author: kocotian <kocotian@kocotian.pl>
Date:   Mon,  5 Apr 2021 13:54:20 +0200

Getting parent pid now via getpid()

Diffstat:
Mgatteur.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gatteur.c b/gatteur.c @@ -164,8 +164,8 @@ main(int argc, char *argv[]) if ((outputfd = accept(inputfd, (struct sockaddr *)&outputaddr_in, &outputlen)) < 0) continue; - if ((parent_pid = fork()) == 0) { - + if (fork() == 0) { + parent_pid = getpid(); if ((targetfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) goto clean;