Re: [idlestat 2/6] Print more details when fopen fails

2014-06-03 Thread Mohammad Merajul Islam Molla
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

[idlestat 2/6] Print more details when fopen fails

2014-06-02 Thread Amit Kucheria
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.