X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=src%2Fpipe.go;h=0f0ac9d111eeca33358469f50b69071f311b758a;hb=0367cce2741e1ce6a89a49fd5c4e9df6005c9744;hp=a250ceedd2b2548140ec69bae513ee5f1dfb3e50;hpb=510478b83a2808262f7167fffe5296b489a2bf03;p=nncp.git diff --git a/src/pipe.go b/src/pipe.go index a250cee..0f0ac9d 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-2022 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 }