[systemd-commits] src/nspawn.c
Lennart Poettering
lennart at kemper.freedesktop.org
Tue Mar 15 19:27:08 PDT 2011
src/nspawn.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
New commits:
commit 715ac17a84f7d721dec613d86d83e671704fafcc
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Mar 16 03:27:02 2011 +0100
nspawn: bind mount /etc/localtime
diff --git a/src/nspawn.c b/src/nspawn.c
index cd528de..aaa5d1f 100644
--- a/src/nspawn.c
+++ b/src/nspawn.c
@@ -125,9 +125,9 @@ static int mount_all(const char *dest) {
unsigned k;
int r = 0;
+ char *where;
for (k = 0; k < ELEMENTSOF(mount_table); k++) {
- char *where;
int t;
if (asprintf(&where, "%s/%s", dest, mount_table[k].where) < 0) {
@@ -167,6 +167,13 @@ static int mount_all(const char *dest) {
free(where);
}
+ /* Fix the timezone, if possible */
+ if (asprintf(&where, "%s/%s", dest, "/etc/localtime") >= 0) {
+ mount("/etc/localtime", where, "bind", MS_BIND, NULL);
+ mount("/etc/localtime", where, "bind", MS_BIND|MS_REMOUNT|MS_RDONLY, NULL);
+ free(where);
+ }
+
return r;
}
More information about the systemd-commits
mailing list