Skip to content

Commit

Permalink
fix(dracut-install): fix variable hides another variable of the same …
Browse files Browse the repository at this point in the history
  • Loading branch information
LaszloGombos committed Feb 23, 2023
1 parent f9bcd4d commit ec1b780
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/install/dracut-install.c
Original file line number Diff line number Diff line change
Expand Up @@ -1177,12 +1177,12 @@ static int parse_argv(int argc, char *argv[])
uname(&buf);

char fw_path_para[PATH_MAX + 1] = "";
int path = open("/sys/module/firmware_class/parameters/path", O_RDONLY | O_CLOEXEC);
if (path != -1) {
ssize_t rd = read(path, fw_path_para, PATH_MAX);
int fd_path = open("/sys/module/firmware_class/parameters/path", O_RDONLY | O_CLOEXEC);
if (fd_path != -1) {
ssize_t rd = read(fd_path, fw_path_para, PATH_MAX);
if (rd != -1)
fw_path_para[rd - 1] = '\0';
close(path);
close(fd_path);
}
char uk[22 + sizeof(buf.release)], fk[14 + sizeof(buf.release)];
sprintf(uk, "/lib/firmware/updates/%s", buf.release);
Expand Down

0 comments on commit ec1b780

Please sign in to comment.