--- projects/cms/source/ihost/libstatgrab/load_stat.c 2002/05/12 19:10:55 1.1 +++ projects/cms/source/ihost/libstatgrab/load_stat.c 2002/05/17 13:56:20 1.5 @@ -1,8 +1,11 @@ #include #include +#ifdef SOLARIS +#include +#endif #include "ukcprog.h" -char* get_load_stats(){ +char *get_load_stats(){ double loadav[3]; char *xml_load_out; @@ -18,7 +21,10 @@ char* get_load_stats(){ return NULL; } - fscanf(f,"%lf %lf %lf", &loadav[0], &loadav[1], &loadav[2]); + if((fscanf(f,"%lf %lf %lf", &loadav[0], &loadav[1], &loadav[2])) != 3){ + errf("Failed to read in sufficent loads"); + return NULL; + } if ((fclose(f)) != 0) { errf("Failed to close file (%m)."); @@ -30,7 +36,7 @@ char* get_load_stats(){ } #endif - xml_load_out=strf("%.2lf%.2lf%.2lf\n", loadav[0], loadav[1], loadav[2]); + xml_load_out=strf("%.2lf%.2lf%.2lf", loadav[0], loadav[1], loadav[2]); return xml_load_out; }