Skip to content

Commit c3111cd

Browse files
committed
linux: fix a warning about fgets return value not being used.
Reading /proc/cmdline will hardly fail anyway. Signed-off-by: Brice Goglin <[email protected]>
1 parent 8e75610 commit c3111cd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

hwloc/topology-linux.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5711,7 +5711,8 @@ hwloc_linuxfs_check_kernel_cmdline(struct hwloc_linux_backend_data_s *data)
57115711
return;
57125712

57135713
cmdline[0] = 0;
5714-
fgets(cmdline, sizeof(cmdline), file);
5714+
if (!fgets(cmdline, sizeof(cmdline), file))
5715+
goto out;
57155716

57165717
fakenuma = strstr(cmdline, "numa=fake=");
57175718
if (fakenuma) {
@@ -5730,6 +5731,7 @@ hwloc_linuxfs_check_kernel_cmdline(struct hwloc_linux_backend_data_s *data)
57305731
hwloc_debug("Found fake numa %d\n", data->is_fake_numa_uniform);
57315732
}
57325733

5734+
out:
57335735
fclose(file);
57345736
}
57355737

0 commit comments

Comments
 (0)