]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/pipe.go
Raise copyright years
[nncp.git] / src / pipe.go
index a250ceedd2b2548140ec69bae513ee5f1dfb3e50..0f0ac9d111eeca33358469f50b69071f311b758a 100644 (file)
@@ -1,6 +1,6 @@
 /*
 NNCP -- Node to Node copy, utilities for store-and-forward data exchange
-Copyright (C) 2016-2020 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2016-2022 Sergey Matveev <stargrave@stargrave.org>
 
 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
 }