]> git.proxmox.com Git - mirror_qemu.git/commit - qga/commands-win32.c
qga: fix append file open modes for win32
authorKirk Allan <kallan@suse.com>
Tue, 10 Nov 2015 23:19:11 +0000 (16:19 -0700)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 11 Nov 2015 16:21:02 +0000 (10:21 -0600)
commit52074d0f662fc51293d4cde8077631f754784405
tree84027a52585955b142e0d0e889b7b8f867afa7c3
parent3c07587d49458341510360557c849e93e9afaf59
qga: fix append file open modes for win32

For append file open modes, use FILE_APPEND_DATA for the desired access
for writing at the end of the file.

Version 2:
For "a+", "ab+", and "a+b" modes use FILE_APPEND_DATA|GENERIC_READ.
ORing in GENERIC_READ starts a read at the begining of the file.  All
writes will append to the end fo the file.

Added white space to maintain the alignment of the guest_file_open_modes[].

Signed-off-by: Kirk Allan <kallan@suse.com>
Cc: qemu-stable@nongnu.org
* use FILE_GENERIC_APPEND macro, which provides same semantics as
  FILE_APPEND_DATA, but retains other flags from GENERIC_WRITE
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
qga/commands-win32.c