Fix missing parameter in popen call
authorMartin Kroeker <martin@ruby.chemie.uni-freiburg.de>
Thu, 6 Dec 2018 17:33:05 +0000 (18:33 +0100)
committerGitHub <noreply@github.com>
Thu, 6 Dec 2018 17:33:05 +0000 (18:33 +0100)
cpuid_power.c

index 23e98eb..82a3f4a 100644 (file)
@@ -136,7 +136,7 @@ int detect(void){
   char buffer[512], *p;
 
   p = (char *)NULL;
-  infile = popen("prtconf|grep 'Processor Type'");
+  infile = popen("prtconf|grep 'Processor Type'", "r");
   while (fgets(buffer, sizeof(buffer), infile)){
     if (!strncmp("Pro", buffer, 3)){
        p = strchr(buffer, ':') + 2;