0001-cpunum.patch 730 B

123456789101112131415161718192021222324252627
  1. From bf646965f75cdad77a45fa3b0046e093b202b2ce Mon Sep 17 00:00:00 2001
  2. From: Gustavo Zacarias <gustavo@zacarias.com.ar>
  3. Date: Thu, 22 Jul 2010 12:42:10 -0300
  4. Subject: [PATCH] Make cpu number counter more reliable
  5. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
  6. ---
  7. iostat.c | 2 +-
  8. 1 files changed, 1 insertions(+), 1 deletions(-)
  9. diff --git a/iostat.c b/iostat.c
  10. index 13e2af7..5d74085 100644
  11. --- a/iostat.c
  12. +++ b/iostat.c
  13. @@ -140,7 +140,7 @@ void get_number_of_cpus()
  14. handle_error("Can't open /proc/cpuinfo", !ncpufp);
  15. while (fgets(buffer, sizeof(buffer), ncpufp)) {
  16. - if (!strncmp(buffer, "processor\t:", 11))
  17. + if (!strncasecmp(buffer, "processor\t", 10))
  18. ncpu++;
  19. }
  20. fclose(ncpufp);
  21. --
  22. 1.7.1