On Wed, Nov 01, 2017 at 02:25:24PM +0000, Ross Lagerwall wrote: > The code wrongly passes the mode to open() only if O_WRONLY is set. > Instead, the mode should be passed when O_CREAT is set (or O_TMPFILE on > Linux). Fix this by always passing the mode since open() will correctly > ignore the mode if it is not needed. Add a testcase which exercises this > bug and also change the existing testcase to check that the mode of the > created file is correct. > > Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> > --- > Changed in v2: > * Separated from qemu_open() change. > > include/io/channel-file.h | 2 +- > io/channel-file.c | 6 +----- > tests/test-io-channel-file.c | 29 +++++++++++++++++++++++++---- > 3 files changed, 27 insertions(+), 10 deletions(-)
Reviewed-by: Daniel P. Berrange <berra...@redhat.com> Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|