]> xenbits.xensource.com Git - libvirt.git/commitdiff
LXC do not truncate container log files on restart
authorAmy Griffis <amy.griffis@hp.com>
Thu, 8 Oct 2009 15:37:09 +0000 (17:37 +0200)
committerDaniel Veillard <veillard@redhat.com>
Thu, 8 Oct 2009 15:37:09 +0000 (17:37 +0200)
* src/lxc/lxc_driver.c: use O_APPEND instead of O_TRUNC when opening
  the log file on lxcVmStart()

src/lxc/lxc_driver.c

index 55210e4f17487ebdebd4ee7795f0e6a961aaeffa..ecdd5b7797332c447e4b238deab4a6adaa1bb489 100644 (file)
@@ -1153,7 +1153,7 @@ static int lxcVmStart(virConnectPtr conn,
         goto cleanup;
     }
 
-    if ((logfd = open(logfile, O_WRONLY | O_TRUNC | O_CREAT,
+    if ((logfd = open(logfile, O_WRONLY | O_APPEND | O_CREAT,
              S_IRUSR|S_IWUSR)) < 0) {
         virReportSystemError(conn, errno,
                              _("failed to open '%s'"),