/
githubmirror
/
origin
Обзор
Документация
Войти
/
githubmirror
/
origin
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
vendor/github.com/moby/go-archive/diff_unix.go
21 строка
634 B
jubittajohn
bump(k8s): go mod vendor
27 мар 2026, 14:25
27 мар 2026, 14:25
70df6d3
Код
Авторство
О чём код?
//go:build !windows package archive import "golang.org/x/sys/unix" // overrideUmask sets current process's file mode creation mask to newmask // and returns a function to restore it. // // WARNING for readers stumbling upon this code. Changing umask in a multi- // threaded environment isn't safe. Don't use this without understanding the // risks, and don't export this function for others to use (we shouldn't even // be using this ourself). // // FIXME(thaJeztah): we should get rid of these hacks if possible. func overrideUmask(newMask int) func() { oldMask := unix.Umask(newMask) return func() { unix.Umask(oldMask) } }