The following commit has been merged in the master branch:
commit 9dceac005a0331ceb840f9c8273c7fd195413516
Author: Raphaël Hertzog <[email protected]>
Date: Mon Sep 12 09:18:06 2011 +0200
Revert "u-a: Use xreadlink() instead of areadlink() in alternative_evolve()"
This reverts commit 6c481e19a532080643e3cf5c76760df8009ea2c7 and
changes the surrounding code to deal correctly with the case where
areadlink() returns NULL.
This part of the code really had to cope with a non-existing
/etc/alternatives/slave.
Reported-by: Sven Joachim <[email protected]>
diff --git a/utils/update-alternatives.c b/utils/update-alternatives.c
index feef7ed..3b3bad5 100644
--- a/utils/update-alternatives.c
+++ b/utils/update-alternatives.c
@@ -2121,12 +2121,12 @@ alternative_evolve(struct alternative *a, struct
alternative *b,
char *lnk;
xasprintf(&lnk, "%s/%s", altdir, sl->name);
- new_file = xreadlink(lnk);
+ new_file = areadlink(lnk);
free(lnk);
}
if (strcmp(old, new) != 0 && lstat(old, &st) == 0 &&
S_ISLNK(st.st_mode)) {
- if (stat(new_file, &st) == 0) {
+ if (new_file && stat(new_file, &st) == 0) {
info(_("renaming %s slave link from %s to %s."),
sl->name, old, new);
checked_mv(old, new);
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]