Révision c86e4ab2
multicpu1sec-c: implement the "fetch" cmd
| plugins/system/multicpu1sec/multicpu1sec-c.c | ||
|---|---|---|
| 126 | 126 |
|
| 127 | 127 |
int fetch() {
|
| 128 | 128 |
printf("fetch()\n");
|
| 129 |
FILE* cache_file = fopen(cache_filename, "r"); |
|
| 129 | 130 |
|
| 130 |
return 0; |
|
| 131 |
/* cat the cache_file to stdout */ |
|
| 132 |
char buffer[1024]; |
|
| 133 |
while (fgets(buffer, 1024, cache_file)) {
|
|
| 134 |
printf("%s", buffer);
|
|
| 135 |
} |
|
| 136 |
|
|
| 137 |
ftruncate(fileno(cache_file), 0); |
|
| 138 |
fclose(cache_file); |
|
| 131 | 139 |
} |
| 132 | 140 |
|
| 133 | 141 |
int main(int argc, char **argv) {
|
Formats disponibles : Unified diff