intel_gpu_dump: Mention filename in error message
authorCarl Worth <cworth@cworth.org>
Mon, 13 Apr 2009 21:06:00 +0000 (14:06 -0700)
committerCarl Worth <cworth@cworth.org>
Mon, 13 Apr 2009 21:06:00 +0000 (14:06 -0700)
This helps for when the user makes a typo trying to pass a file
or directory name to intel_gpu_dump.

tools/intel_gpu_dump.c

index 8ddfbd3..947617e 100644 (file)
@@ -1962,8 +1962,11 @@ main (int argc, char *argv[])
     } else {
        path = argv[1];
        err = stat(path, &st);
-       if (err != 0)
-           errx(1, "Couldn't stat the file or directory\n");
+       if (err != 0) {
+           fprintf (stderr, "Error opening %s: %s\n",
+                    path, strerror (errno));
+           exit (1);
+       }
     }
 
     if (S_ISDIR(st.st_mode)) {