[systemd-devel] [PATCH v9002 1/2] timedated: gather timezone from /etc/localtime sym target
shawn
shawnlandden at gmail.com
Fri Aug 24 09:35:35 PDT 2012
On Thu, 2012-08-23 at 14:21 +0200, Frederic Crozat wrote:
> Le mardi 21 août 2012 à 23:11 -0700, Shawn Landden a écrit :
>
> > @@ -218,19 +248,21 @@ static int write_data_timezone(void) {
> > return r;
> > }
> >
> > - p = strappend("/usr/share/zoneinfo/", tz.zone);
> > + p = strappend(ZONEINFO_PATH, tz.zone);
> > if (!p)
> > return log_oom();
> >
> > - r = symlink_or_copy_atomic(p, "/etc/localtime");
> > + r = symlink(p, "/etc/localtime");
> > free(p);
>
> It doesn't work when /etc/localtime already exists, because symlink
> returns EEXIST. I guess you should put back your symlink_atomic patch..
>
yes, and the other errors like ENOTDIR and EACCESS and ENOENT that can
result from this action would all be after removing it, if using
symlink() directly with a remove, and not a atomic rename. There were
reasons I created symlink_atomic()...
--
-Shawn Landden
More information about the systemd-devel
mailing list