From: Ian Jackson Date: Mon, 28 Nov 2011 17:19:28 +0000 (+0000) Subject: libxl: open logs with O_APPEND X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4c0192c80576ef9d762256adcb3e702d75342b1b;p=xen.git libxl: open logs with O_APPEND Logfiles should always be opened for append. Signed-off-by: Ian Jackson Acked-by: Ian Campbell Committed-by: Ian Jackson --- 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);