]> Cypherpunks repositories - nncp.git/commitdiff
Ensure neighboor directory existence during tossing
authorSergey Matveev <stargrave@stargrave.org>
Fri, 6 Jan 2017 11:46:59 +0000 (14:46 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Fri, 6 Jan 2017 11:46:59 +0000 (14:46 +0300)
src/cypherpunks.ru/nncp/toss.go

index e95f7beeff85004adf777d193e660b9809e93f7f..42090a8effb3f2fc0b23eaeeca4674748ef4e05a 100644 (file)
@@ -49,6 +49,7 @@ func newNotification(fromTo *FromToYAML, subject string) io.Reader {
 }
 
 func (ctx *Ctx) LockDir(nodeId *NodeId, xx TRxTx) (*os.File, error) {
+       ctx.ensureRxDir(nodeId)
        lockPath := filepath.Join(ctx.Spool, nodeId.String(), string(xx)) + ".lock"
        dirLock, err := os.OpenFile(
                lockPath,