Skip to content

Commit

Permalink
libbpf-tools/profile: Check if nr_cpus is zero
Browse files Browse the repository at this point in the history
  • Loading branch information
Bojun-Seo committed Oct 8, 2024
1 parent cb1ba20 commit b88af0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libbpf-tools/profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ int main(int argc, char **argv)
libbpf_set_print(libbpf_print_fn);

nr_cpus = libbpf_num_possible_cpus();
if (nr_cpus < 0) {
if (nr_cpus <= 0) {
printf("failed to get # of possible cpus: '%s'!\n",
strerror(-nr_cpus));
return 1;
Expand Down

0 comments on commit b88af0c

Please sign in to comment.