]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/cmd/nncp-reass/main.go
NNCPNOSYNC environment variable
[nncp.git] / src / cmd / nncp-reass / main.go
index 6a237f4ea1b3d54499e43337adb1686dd8c92b52..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
@@ -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)