projects
/
platform
/
upstream
/
connman.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cb53c7f
)
timezone: Remove /etc/localtime if it's a symbolic link
author
Yu A Wang
<yu.a.wang@intel.com>
Fri, 8 Jul 2011 17:15:37 +0000
(19:15 +0200)
committer
Samuel Ortiz
<sameo@linux.intel.com>
Fri, 8 Jul 2011 17:21:08 +0000
(19:21 +0200)
And copy the timezone file over.
Fixes BMC #18887
src/timezone.c
patch
|
blob
|
history
diff --git
a/src/timezone.c
b/src/timezone.c
index
c6d8d68
..
08f904f
100644
(file)
--- a/
src/timezone.c
+++ b/
src/timezone.c
@@
-271,11
+271,17
@@
done:
static int write_file(void *src_map, struct stat *src_st, const char *pathname)
{
+ struct stat st;
int fd;
ssize_t written;
DBG("pathname %s", pathname);
+ if (lstat(pathname, &st) == 0) {
+ if (S_ISLNK(st.st_mode))
+ unlink(pathname);
+ }
+
fd = open(pathname, O_WRONLY | O_CREAT | O_TRUNC, 0644);
if (fd < 0)
return -EIO;