diff options
| author | Mickaël Salaün <mic@linux.microsoft.com> | 2021-02-11 19:21:13 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2021-02-17 16:44:44 +0100 |
| commit | ca27dbdcc612206296b7bfeb2107050f9da31ac4 (patch) | |
| tree | b4cf56451ee873ccc986f8024e6938c934555fff /sys | |
| parent | 052f8d9f67bd9f945cc9863881fa02dbc8fcf691 (diff) | |
sys/targets: allow to create /dev/null
Do not tamper character device creation when creating /dev/null .
Signed-off-by: Mickaël Salaün <mic@linux.microsoft.com>
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/targets/common.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/targets/common.go b/sys/targets/common.go index bddd90f9d..193e9dca6 100644 --- a/sys/targets/common.go +++ b/sys/targets/common.go @@ -123,6 +123,9 @@ func (arch *UnixNeutralizer) Neutralize(c *prog.Call) { mode.Val &^= arch.S_IFBLK mode.Val |= arch.S_IFREG case arch.S_IFCHR: + if dev.Val == 0x103 { + break // /dev/null + } mode.Val &^= arch.S_IFCHR mode.Val |= arch.S_IFREG } |
