1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 02:51:03 +00:00

multicpu1sec-c: implement the "fetch" cmd

This commit is contained in:
Steve Schnepp 2015-03-03 22:29:41 +00:00
parent 9ac74f8d9b
commit c86e4ab2fd

View file

@ -126,8 +126,16 @@ int acquire() {
int fetch() {
printf("fetch()\n");
FILE* cache_file = fopen(cache_filename, "r");
return 0;
/* cat the cache_file to stdout */
char buffer[1024];
while (fgets(buffer, 1024, cache_file)) {
printf("%s", buffer);
}
ftruncate(fileno(cache_file), 0);
fclose(cache_file);
}
int main(int argc, char **argv) {