]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/cmd/nncp-xfer/main.go
NNCPNOSYNC environment variable
[nncp.git] / src / cmd / nncp-xfer / main.go
index 41e8c61c8e157f087d9fa5096990d92231bf316d..68aa102aa68970c117444499bf51b90951f75b31 100644 (file)
@@ -477,13 +477,15 @@ Tx:
                                isBad = true
                                continue
                        }
-                       if err = tmp.Sync(); err != nil {
-                               tmp.Close()
-                               ctx.LogE("xfer-tx-sync", les, err, func(les nncp.LEs) string {
-                                       return logMsg(les) + ": syncing"
-                               })
-                               isBad = true
-                               continue
+                       if !nncp.NoSync {
+                               if err = tmp.Sync(); err != nil {
+                                       tmp.Close()
+                                       ctx.LogE("xfer-tx-sync", les, err, func(les nncp.LEs) string {
+                                               return logMsg(les) + ": syncing"
+                                       })
+                                       isBad = true
+                                       continue
+                               }
                        }
                        if err = tmp.Close(); err != nil {
                                ctx.LogE("xfer-tx-close", les, err, func(les nncp.LEs) string {