X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=src%2Fpipe.go;h=0f0ac9d111eeca33358469f50b69071f311b758a;hb=0367cce2741e1ce6a89a49fd5c4e9df6005c9744;hp=1b50573bf75fb983283452f9b2c746f844a7ab2d;hpb=622e37f1efb48a710f5bf68aaa059f594a7d4a8e;p=nncp.git diff --git a/src/pipe.go b/src/pipe.go index 1b50573..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,9 +65,11 @@ func (c PipeConn) SetWriteDeadline(t time.Time) error { } func (c PipeConn) Close() (err error) { - c.r.Close() + 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 }