aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Jackson <Ian.Jackson@eu.citrix.com>2011-11-28 17:19:28 +0000
committerIan Jackson <Ian.Jackson@eu.citrix.com>2011-11-28 17:19:28 +0000
commit4c0192c80576ef9d762256adcb3e702d75342b1b (patch)
tree1892eaa906e8fe7efa21cfcba832d85386d07a03
parentff167f07a8cd83ee61306c011bef8e62da385e1c (diff)
downloadxen-4c0192c80576ef9d762256adcb3e702d75342b1b.tar.gz
xen-4c0192c80576ef9d762256adcb3e702d75342b1b.tar.bz2
xen-4c0192c80576ef9d762256adcb3e702d75342b1b.zip
libxl: open logs with O_APPEND
Logfiles should always be opened for append. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
-rw-r--r--tools/libxl/libxl_dm.c2
-rw-r--r--tools/libxl/xl_cmdimpl.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index bf38877de1..cef80be594 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -830,7 +830,7 @@ int libxl__create_device_model(libxl__gc *gc,
libxl__xs_write(gc, XBT_NULL, libxl__sprintf(gc, "%s/disable_pf", path), "%d", !info->xen_platform_pci);
libxl_create_logfile(ctx, libxl__sprintf(gc, "qemu-dm-%s", info->dom_name), &logfile);
- logfile_w = open(logfile, O_WRONLY|O_CREAT, 0644);
+ logfile_w = open(logfile, O_WRONLY|O_CREAT|O_APPEND, 0644);
free(logfile);
null = open("/dev/null", O_RDONLY);
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 080aa2bb0f..a9b7ef2e39 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1597,7 +1597,8 @@ start:
exit(-1);
}
- CHK_ERRNO(( logfile = open(fullname, O_WRONLY|O_CREAT, 0644) )<0);
+ CHK_ERRNO(( logfile = open(fullname, O_WRONLY|O_CREAT|O_APPEND,
+ 0644) )<0);
free(fullname);
free(name);