summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/nsinstall.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/config/nsinstall.c b/config/nsinstall.c
index 56d4d304..8799e255 100644
--- a/config/nsinstall.c
+++ b/config/nsinstall.c
@@ -314,10 +314,13 @@ main(int argc, char **argv)
}
/* Check for a pre-existing symlink with identical content. */
- if (exists &&
- (!S_ISLNK(tosb.st_mode) ||
- readlink(toname, buf, sizeof buf) != len ||
- strncmp(buf, name, len) != 0)) {
+ if (exists) {
+ if (S_ISLNK(tosb.st_mode) &&
+ readlink(toname, buf, sizeof buf) == len &&
+ strncmp(buf, name, len) == 0) {
+ /*fprintf(stderr,"link exists: %s => %.*s\n", toname, len, buf);*/
+ continue;
+ }
(void) (S_ISDIR(tosb.st_mode) ? rmdir : unlink)(toname);
exists = 0;
}