WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] xenpaging: add helper function for unlink

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xenpaging: add helper function for unlinking pagefile
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Tue, 28 Jun 2011 07:44:28 +0100
Delivery-date: Mon, 27 Jun 2011 23:50:15 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Olaf Hering <olaf@xxxxxxxxx>
# Date 1307695645 -7200
# Node ID 2fe46305a00d81585604ab56a772fc3bd5ce1ee0
# Parent  7d72475641fa392c8d457bc978db3c9015a7ffff
xenpaging: add helper function for unlinking pagefile

Unlink pagefile in the signal handler and also in the exit path.
This does not leave a stale pagefile if an error occoured.

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 7d72475641fa -r 2fe46305a00d tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c       Fri Jun 10 10:47:24 2011 +0200
+++ b/tools/xenpaging/xenpaging.c       Fri Jun 10 10:47:25 2011 +0200
@@ -41,11 +41,20 @@
 
 static char filename[80];
 static int interrupted;
+
+static void unlink_pagefile(void)
+{
+    if ( filename[0] )
+    {
+        unlink(filename);
+        filename[0] = '\0';
+    }
+}
+
 static void close_handler(int sig)
 {
     interrupted = sig;
-    if ( filename[0] )
-        unlink(filename);
+    unlink_pagefile();
 }
 
 static int xenpaging_mem_paging_flush_ioemu_cache(xenpaging_t *paging)
@@ -716,6 +725,7 @@
 
  out:
     close(fd);
+    unlink_pagefile();
     free(victims);
 
     /* Tear down domain paging */

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xenpaging: add helper function for unlinking pagefile, Xen patchbot-unstable <=