forked from opencontainers/runc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow libcontainer/configs to be imported on Windows
Signed-off-by: Daniel J Walsh <[email protected]>
- Loading branch information
Showing
3 changed files
with
21 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// +build !windows | ||
|
||
package configs | ||
|
||
import ( | ||
"errors" | ||
|
||
"golang.org/x/sys/unix" | ||
) | ||
|
||
func (d *DeviceRule) Mkdev() (uint64, error) { | ||
if d.Major == Wildcard || d.Minor == Wildcard { | ||
return 0, errors.New("cannot mkdev() device with wildcards") | ||
} | ||
return unix.Mkdev(uint32(d.Major), uint32(d.Minor)), nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package configs | ||
|
||
func (d *DeviceRule) Mkdev() (uint64, error) { | ||
return 0, nil | ||
} |