File 0028-appliance-Touch-cached-appliance-files-so-they-don-t.patch of Package libguestfs
From de2a0a79300950065371ef7e0dadd356402070ca Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones@redhat.com>
Date: Sat, 11 Dec 2010 23:23:36 +0000
Subject: [PATCH 28/72] appliance: Touch cached appliance files so they don't get tmp cleaned.
(cherry picked from commit f410d571ccbf54b34937dab2868614d35fe59855)
---
src/appliance.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/appliance.c b/src/appliance.c
index 4039117..d7e7058 100644
--- a/src/appliance.c
+++ b/src/appliance.c
@@ -567,18 +567,23 @@ hard_link_to_cached_appliance (guestfs_h *g,
perrorf (g, "link: %s %s", filename, *kernel);
goto error;
}
+ (void) lutimes (filename, NULL); /* lutimes because it's a symlink */
+
snprintf (filename, len, "%s/initrd", cachedir);
(void) unlink (*initrd);
if (link (filename, *initrd) == -1) {
perrorf (g, "link: %s %s", filename, *initrd);
goto error;
}
+ (void) utime (filename, NULL);
+
snprintf (filename, len, "%s/root", cachedir);
(void) unlink (*appliance);
if (link (filename, *appliance) == -1) {
perrorf (g, "link: %s %s", filename, *appliance);
goto error;
}
+ (void) utime (filename, NULL);
return 0;
--
1.7.1