summaryrefslogtreecommitdiffstats
path: root/src/proc-linux.c
diff options
context:
space:
mode:
authorWilliam Jon McCann <mccann@jhu.edu>2007-03-06 16:07:24 -0500
committerWilliam Jon McCann <mccann@jhu.edu>2007-03-06 16:07:24 -0500
commitdc5e9585215f34ec78b68fbb6da990a90d8f3a1b (patch)
treeed64be3c15a74a9f98083d2ad0bdf6bcc973caf7 /src/proc-linux.c
parentce4ee7b54d40faf13e005285e5b85a061f21e256 (diff)
use paths.h if available
Diffstat (limited to 'src/proc-linux.c')
-rw-r--r--src/proc-linux.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/proc-linux.c b/src/proc-linux.c
index 30e7d22..a247e75 100644
--- a/src/proc-linux.c
+++ b/src/proc-linux.c
@@ -28,6 +28,10 @@
#include <sys/types.h>
#include <sys/stat.h>
+#ifdef HAVE_PATHS_H
+#include <paths.h>
+#endif /* HAVE_PATHS_H */
+
#include "proc.h"
/* adapted from procps */
@@ -107,7 +111,7 @@ load_drivers (void)
buf[bytes] = '\0';
p = buf;
- while ((p = strstr (p, " /dev/"))){
+ while ((p = strstr (p, " " _PATH_DEV))){
tty_map_node *tmn;
int len;
char *end;
@@ -188,7 +192,7 @@ driver_name (guint maj,
tmn = tmn->next;
}
- tty = g_strdup_printf ("/dev/%s%d", tmn->name, min); /* like "/dev/ttyZZ255" */
+ tty = g_strdup_printf (_PATH_DEV "%s%d", tmn->name, min); /* like "/dev/ttyZZ255" */
if (stat (tty, &sbuf) < 0){
g_free (tty);
@@ -196,7 +200,7 @@ driver_name (guint maj,
return NULL;
}
- tty = g_strdup_printf ("/dev/%s", tmn->name); /* like "/dev/ttyZZ255" */
+ tty = g_strdup_printf (_PATH_DEV "%s", tmn->name); /* like "/dev/ttyZZ255" */
if (stat (tty, &sbuf) < 0) {
g_free (tty);