Skip to contentSkip to conversation

qemu exec.c monitor.c

Qemu-devel Paul Brook 3 participants 3 messages Jun 30, 2007 – Jul 1, 2007

lore
Share & tools
lore
#1 lore raw

ANSI / POSIX do not define "wa" as mode string for fopen. I have no idea how many implementations of libc will fail with this mode which was introduced by the latest version of exec.c.

The standard mode for append is just "a". Even better (because it is faster and creates smaller log files for Windows) is "ab" for append and "wb" otherwise.

Stefan

Quoted 10 lines · Paul Brook

CVSROOT: /sources/qemu
Module name: qemu
Changes by: Paul Brook <pbrook> 07/06/30 13:53:24

Modified files:
. : exec.c monitor.c

Log message:
Allow changing log filename.
Close logfile when logging is disabled.

#2 lore raw
Quoted 6 lines · Stefan Weil

ANSI / POSIX do not define "wa" as mode string for fopen. I have no idea how many implementations of libc will fail with this mode which was introduced by the latest version of exec.c.

The standard mode for append is just "a".

You are correct. I've fixed this.

Quoted 3 lines

Even better (because it is faster and creates smaller log files for Windows) is "ab" for append and "wb" otherwise.

We're writing human-readable text, so opening in binary mode is IMHO fairly dubious. If you really want fast logs/traces there are better ways to speed it up.

Paul