mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-10 21:53:57 +08:00
rootfs: switch createDevices argument order
This argument order matches most other helpers we have and will also match the changes we are about to make to setupPtmx and setupDevSymlinks. Signed-off-by: Aleksa Sarai <aleksa@amutable.com>
This commit is contained in:
@@ -184,7 +184,7 @@ func prepareRootfs(pipe *syncSocket, iConfig *initConfig) (err error) {
|
|||||||
|
|
||||||
setupDev := needsSetupDev(config)
|
setupDev := needsSetupDev(config)
|
||||||
if setupDev {
|
if setupDev {
|
||||||
if err := createDevices(config, rootFd); err != nil {
|
if err := createDevices(rootFd, config); err != nil {
|
||||||
return fmt.Errorf("error creating device nodes: %w", err)
|
return fmt.Errorf("error creating device nodes: %w", err)
|
||||||
}
|
}
|
||||||
if err := setupPtmx(config); err != nil {
|
if err := setupPtmx(config); err != nil {
|
||||||
@@ -949,7 +949,7 @@ func reOpenDevNull() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create the device nodes in the container.
|
// Create the device nodes in the container.
|
||||||
func createDevices(config *configs.Config, rootFd *os.File) error {
|
func createDevices(rootFd *os.File, config *configs.Config) error {
|
||||||
useBindMount := userns.RunningInUserNS() || config.Namespaces.Contains(configs.NEWUSER)
|
useBindMount := userns.RunningInUserNS() || config.Namespaces.Contains(configs.NEWUSER)
|
||||||
for _, node := range config.Devices {
|
for _, node := range config.Devices {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user