You must login to view /gokrazy/internal/src/commit/8b3fd7aed8bb1e05bea95b002363c586fac2ac24/config.
The GitHub option should be usable for most people, it only links via username.

Files
tools/packer/packer_linux.go
Olivier Mengué 772c0a9421 packer: move call to unix.Sync behind Linux conditional compile (#84)
In RereadPartitions, move call to unix.Sync() in Linux specific code
as unix.Sync() is not portable (not available on Windows).
2025-02-21 20:39:03 +01:00

25 lines
399 B
Go

package packer
import (
"os"
"golang.org/x/sys/unix"
)
func rereadPartitions(o *os.File) error {
// Make Linux re-read the partition table. Sequence of system calls like in fdisk(8).
unix.Sync()
if _, _, errno := unix.Syscall(unix.SYS_IOCTL, uintptr(o.Fd()), unix.BLKRRPART, 0); errno != 0 {
return errno
}
if err := o.Sync(); err != nil {
return err
}
unix.Sync()
return nil
}