Hello Amit,
In the last section f should be 'stderr' in fprintf -
@@ -1080,8 +1082,9 @@ static int idlestat_store(const char *path)
return -1;
f = fopen(path, "w+");
+
if (!f) {
- fprintf(f, "failed to open '%s': %m\n", path);
+ fprintf
From: Amit Kucheria
Useful for tracking down why the following command fails:
sudo ./idlestat -o /tmp/newfile
where, newfile doesn't already exist
Signed-off-by: Amit Kucheria
---
idlestat.c | 11 +++
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/idlestat.c b/idlestat.