core/diff/apply: use unix.Syncfs
Use the Syncfs wrapper function defined in the golang.org/x/sys/unix package instead of manually wrapping it in doSyncFs. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
This commit is contained in:
		| @@ -97,9 +97,9 @@ func doSyncFs(file string) error { | |||||||
| 	} | 	} | ||||||
| 	defer fd.Close() | 	defer fd.Close() | ||||||
|  |  | ||||||
| 	_, _, errno := unix.Syscall(unix.SYS_SYNCFS, fd.Fd(), 0, 0) | 	err = unix.Syncfs(int(fd.Fd())) | ||||||
| 	if errno != 0 { | 	if err != nil { | ||||||
| 		return fmt.Errorf("failed to syncfs for %s: %w", file, errno) | 		return fmt.Errorf("failed to syncfs for %s: %w", file, err) | ||||||
| 	} | 	} | ||||||
| 	return nil | 	return nil | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Tobias Klauser
					Tobias Klauser