Sfoglia il codice sorgente

u-a: Use xreadlink() instead of areadlink() in alternative_evolve()

The function does not expect the readlink call to fail.
Guillem Jover 15 anni fa
parent
commit
6c481e19a5
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      utils/update-alternatives.c

+ 1 - 1
utils/update-alternatives.c

@@ -2075,7 +2075,7 @@ alternative_evolve(struct alternative *a, struct alternative *b,
 			char *lnk;
 			char *lnk;
 
 
 			xasprintf(&lnk, "%s/%s", altdir, sl->name);
 			xasprintf(&lnk, "%s/%s", altdir, sl->name);
-			new_file = areadlink(lnk);
+			new_file = xreadlink(lnk);
 			free(lnk);
 			free(lnk);
 		}
 		}
 		if (strcmp(old, new) != 0 && lstat(old, &st) == 0 &&
 		if (strcmp(old, new) != 0 && lstat(old, &st) == 0 &&