commit | ce55a11c7ff54b128631d16ca099c45d75e33fe5 | [log] [tgz] |
---|---|---|
author | Simon Glass <sjg@chromium.org> | Mon Oct 01 11:55:07 2018 -0600 |
committer | Simon Glass <sjg@chromium.org> | Tue Oct 09 04:40:26 2018 -0600 |
tree | 7684005feef776fa06fc966d5ec8b72c29232869 | |
parent | 1b69a99fc9825779e8422c48dad5f96f394fe8d4 [diff] |
sandbox: Support file truncation with os_open() At present files are not truncated on writing. This is a useful feature. Add support for this. Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c index d4d6d78..1d87a53 100644 --- a/arch/sandbox/cpu/os.c +++ b/arch/sandbox/cpu/os.c
@@ -85,6 +85,8 @@ if (os_flags & OS_O_CREAT) flags |= O_CREAT; + if (os_flags & OS_O_TRUNC) + flags |= O_TRUNC; return open(pathname, flags, 0777); }