summaryrefslogtreecommitdiff
path: root/lib/igt_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/igt_core.c')
-rw-r--r--lib/igt_core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/igt_core.c b/lib/igt_core.c
index 3313050c..2d0d78a3 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -1169,10 +1169,10 @@ bool igt_can_fail(void)
static bool run_under_gdb(void)
{
- char buf[1024];
+ char pathname[30], buf[1024];
- sprintf(buf, "/proc/%d/exe", getppid());
- return (readlink (buf, buf, sizeof (buf)) != -1 &&
+ sprintf(pathname, "/proc/%d/exe", getppid());
+ return (readlink(pathname, buf, sizeof (buf)) != -1 &&
strncmp(basename(buf), "gdb", 3) == 0);
}