]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/cmd/nncp-reass/main.go
NNCPNOSYNC environment variable
[nncp.git] / src / cmd / nncp-reass / main.go
index a1ee4a3a9c97aca146f2dfd8c6b44df82ce5fdac..d095f95d041ba4b1c99cc2513828f2e2cce057b7 100644 (file)
@@ -1,6 +1,6 @@
 /*
 NNCP -- Node to Node copy, utilities for store-and-forward data exchange
-Copyright (C) 2016-2021 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
@@ -35,7 +35,7 @@ import (
 
        xdr "github.com/davecgh/go-xdr/xdr2"
        "github.com/dustin/go-humanize"
-       "go.cypherpunks.ru/nncp/v7"
+       "go.cypherpunks.ru/nncp/v8"
 )
 
 func usage() {
@@ -237,8 +237,10 @@ func process(ctx *nncp.Ctx, path string, keep, dryRun, stdout, dumpMeta bool) bo
                log.Fatalln("Can not flush:", err)
        }
        if tmp != nil {
-               if err = tmp.Sync(); err != nil {
-                       log.Fatalln("Can not sync:", err)
+               if !nncp.NoSync {
+                       if err = tmp.Sync(); err != nil {
+                               log.Fatalln("Can not sync:", err)
+                       }
                }
                if err = tmp.Close(); err != nil {
                        log.Fatalln("Can not close:", err)