mirror of
https://github.com/BaaRai/ARTEX.git
synced 2026-11-25 01:10:54 +08:00
writeRemoteArchiveJournal ended with Sync on two directory handles. Windows cannot flush a directory handle, so the journal write failed there and no remote archive or remote deletion could start. Move the directory sync to syncDir: the unix build keeps the fsync, the other builds return nil (the journal file itself is already synced).
19 lines
296 B
Go
19 lines
296 B
Go
//go:build unix
|
|
|
|
package server
|
|
|
|
import (
|
|
"errors"
|
|
"os"
|
|
)
|
|
|
|
// syncDir flushes a directory, so that an entry just created or renamed in it
|
|
// survives a crash.
|
|
func syncDir(path string) error {
|
|
d, err := os.Open(path)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return errors.Join(d.Sync(), d.Close())
|
|
}
|