summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2010-12-11 23:23:36 +0000
committerRichard W.M. Jones <rjones@redhat.com>2010-12-11 23:33:22 +0000
commitf410d571ccbf54b34937dab2868614d35fe59855 (patch)
treef496ea55248c2a7b47eef3d45a44f433855f206f /src
parent3d114fcf84372c52ea769c4bb8efa572936f1f5a (diff)
downloadlibguestfs-f410d571ccbf54b34937dab2868614d35fe59855.tar.gz
libguestfs-f410d571ccbf54b34937dab2868614d35fe59855.tar.xz
libguestfs-f410d571ccbf54b34937dab2868614d35fe59855.zip
appliance: Touch cached appliance files so they don't get tmp cleaned.
Diffstat (limited to 'src')
-rw-r--r--src/appliance.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/appliance.c b/src/appliance.c
index 6d560ec4..30eb6fd4 100644
--- a/src/appliance.c
+++ b/src/appliance.c
@@ -563,18 +563,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;