vmspawn: do not use r for loop count
In a future, we may call some functions and r may be used for storing error code of them. Let's not use r for the maximum number of loop count.
This commit is contained in:
@@ -2513,11 +2513,11 @@ static int run(int argc, char *argv[]) {
|
||||
glyph(GLYPH_LIGHT_SHADE), ansi_grey(), ansi_highlight(), ansi_grey(), ansi_normal());
|
||||
}
|
||||
|
||||
r = sd_listen_fds_with_names(true, &names);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to get passed file descriptors: %m");
|
||||
int n = sd_listen_fds_with_names(true, &names);
|
||||
if (n < 0)
|
||||
return log_error_errno(n, "Failed to get passed file descriptors: %m");
|
||||
|
||||
for (int i = 0; i < r; i++) {
|
||||
for (int i = 0; i < n; i++) {
|
||||
int fd = SD_LISTEN_FDS_START + i;
|
||||
if (streq(names[i], "kvm"))
|
||||
kvm_device_fd = fd;
|
||||
|
||||
Reference in New Issue
Block a user