gojs: implements umask (#1230)
This implements host-side umask for gojs, which allows `os.TestMkdirStickyUmask` to pass. Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
@@ -24,6 +24,7 @@ func NewState(ctx context.Context) *State {
|
||||
values: values.NewValues(),
|
||||
valueGlobal: newJsGlobal(getRoundTripper(ctx)),
|
||||
cwd: getWorkdir(ctx),
|
||||
umask: 0o0022,
|
||||
_nextCallbackTimeoutID: 1,
|
||||
_scheduledTimeouts: map[uint32]chan bool{},
|
||||
}
|
||||
@@ -190,6 +191,8 @@ type State struct {
|
||||
|
||||
// cwd is initially "/"
|
||||
cwd string
|
||||
// umask is initially 0022
|
||||
umask uint32
|
||||
}
|
||||
|
||||
// Get implements the same method as documented on goos.GetFunction
|
||||
@@ -226,6 +229,7 @@ func (s *State) close() {
|
||||
s._lastEvent = nil
|
||||
s._nextCallbackTimeoutID = 1
|
||||
s.cwd = "/"
|
||||
s.umask = 0o0022
|
||||
}
|
||||
|
||||
func toInt64(arg interface{}) int64 {
|
||||
|
||||
Reference in New Issue
Block a user