X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=src%2Fpipe.go;h=cb9460a939e8f4bdd61786e2a8f3ee38d79910a7;hb=cf9363f956cb2d93a581c11ed65c5b02910d10d5;hp=a250ceedd2b2548140ec69bae513ee5f1dfb3e50;hpb=271870ad4f56253e0918f673b90615e4749cf201;p=nncp.git diff --git a/src/pipe.go b/src/pipe.go index a250cee..cb9460a 100644 --- a/src/pipe.go +++ b/src/pipe.go @@ -1,6 +1,6 @@ /* NNCP -- Node to Node copy, utilities for store-and-forward data exchange -Copyright (C) 2016-2020 Sergey Matveev +Copyright (C) 2016-2023 Sergey Matveev This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -65,8 +65,11 @@ func (c PipeConn) SetWriteDeadline(t time.Time) error { } func (c PipeConn) Close() (err error) { + err = c.r.Close() err = c.w.Close() go c.cmd.Wait() - time.AfterFunc(time.Duration(10*time.Second), func() { c.cmd.Process.Kill() }) + time.AfterFunc(time.Duration(10*time.Second), func() { + c.cmd.Process.Kill() + }) return }