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