diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-08-23 15:59:06 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-08-23 16:00:16 +0100 |
commit | b22e90bc8b9c7fe27556558c31f00e35e689a12e (patch) | |
tree | ab3844b5012a310fe4a4c6bfedcc17f564438489 /overlay/debugfs.c | |
parent | 9574cb1a3de0dfe45c59420e2cb9a74fc23baecc (diff) |
overlay: Distinguish the root debugfs path and our dri node
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'overlay/debugfs.c')
-rw-r--r-- | overlay/debugfs.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/overlay/debugfs.c b/overlay/debugfs.c index ccce2279..9f3e5ccb 100644 --- a/overlay/debugfs.c +++ b/overlay/debugfs.c @@ -26,10 +26,12 @@ #include <sys/mount.h> #include <errno.h> #include <stdio.h> +#include <string.h> #include "debugfs.h" char debugfs_path[128]; +char debugfs_dri_path[128]; int debugfs_init(void) { @@ -52,15 +54,16 @@ int debugfs_init(void) return errno; find_minor: + strcpy(debugfs_path, path); for (n = 0; n < 16; n++) { - int len = sprintf(debugfs_path, "%s/dri/%d", path, n); - sprintf(debugfs_path + len, "/i915_error_state"); - if (stat(debugfs_path, &st) == 0) { - debugfs_path[len] = '\0'; + int len = sprintf(debugfs_dri_path, "%s/dri/%d", path, n); + sprintf(debugfs_dri_path + len, "/i915_error_state"); + if (stat(debugfs_dri_path, &st) == 0) { + debugfs_dri_path[len] = '\0'; return 0; } } - debugfs_path[0] = '\0'; + debugfs_dri_path[0] = '\0'; return ENOENT; } |