fix umask for windows
This commit is contained in:
@@ -16,7 +16,6 @@ import (
|
|||||||
"runtime/debug"
|
"runtime/debug"
|
||||||
"strconv"
|
"strconv"
|
||||||
"sync"
|
"sync"
|
||||||
"syscall"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func Start(ctx context.Context) error {
|
func Start(ctx context.Context) error {
|
||||||
@@ -26,8 +25,7 @@ func Start(ctx context.Context) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("invalid UMASK value: %s", umaskStr)
|
return fmt.Errorf("invalid UMASK value: %s", umaskStr)
|
||||||
}
|
}
|
||||||
// Set umask
|
SetUmask(int(umask))
|
||||||
syscall.Umask(int(umask))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cfg := config.GetConfig()
|
cfg := config.GetConfig()
|
||||||
|
|||||||
9
cmd/decypharr/umask_unix.go
Normal file
9
cmd/decypharr/umask_unix.go
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
//go:build !windows
|
||||||
|
|
||||||
|
package decypharr
|
||||||
|
|
||||||
|
import "syscall"
|
||||||
|
|
||||||
|
func SetUmask(umask int) {
|
||||||
|
syscall.Umask(umask)
|
||||||
|
}
|
||||||
8
cmd/decypharr/umask_win.go
Normal file
8
cmd/decypharr/umask_win.go
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
//go:build windows
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package decypharr
|
||||||
|
|
||||||
|
func SetUmask(umask int) {
|
||||||
|
// No-op on Windows
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user