util: Correctly handle short writes in m5 (read|exec)file
authorAndreas Sandberg <andreas.sandberg@arm.com>
Wed, 26 Apr 2017 16:46:13 +0000 (16:46 +0000)
committerAndreas Sandberg <andreas.sandberg@arm.com>
Tue, 9 May 2017 09:24:06 +0000 (09:24 +0000)
commit708258aba60cfeb092b11c2aa6bb867dce233d47
tree5a3ff110076abda388b61c7d5993d86bac353d03
parenta59d153c08f05e5bfdb2689c20329a75abf092b4
util: Correctly handle short writes in m5 (read|exec)file

The m5 tool has subcommands that writes a file to the simulated file
system. The implementation of this command currently doesn't check the
return value from write, which leads to compiler warnings and
potentially incorrect behavior. Add the necessary checks.

Change-Id: If558534d3245aa24cf15edf06bd0af4c6ba3908c
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2962
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
util/m5/m5.c