[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] libxl: open logs with O_APPEND



# HG changeset patch
# User Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
# Date 1322500768 0
# Node ID 5bac57e7ea47580eb5c07dac17fbd70f1c808ded
# Parent  a9c67c2daf4b0181ef2581471ea920eecb495616
libxl: open logs with O_APPEND

Logfiles should always be opened for append.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r a9c67c2daf4b -r 5bac57e7ea47 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c    Mon Nov 28 11:57:23 2011 +0000
+++ b/tools/libxl/libxl_dm.c    Mon Nov 28 17:19:28 2011 +0000
@@ -830,7 +830,7 @@
     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 -r a9c67c2daf4b -r 5bac57e7ea47 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Mon Nov 28 11:57:23 2011 +0000
+++ b/tools/libxl/xl_cmdimpl.c  Mon Nov 28 17:19:28 2011 +0000
@@ -1597,7 +1597,8 @@
             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);
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.