summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/device-nrs.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/device-nrs.h')
-rw-r--r--sysdeps/unix/sysv/linux/device-nrs.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/device-nrs.h b/sysdeps/unix/sysv/linux/device-nrs.h
index d08d81cf25..6b6578ec5f 100644
--- a/sysdeps/unix/sysv/linux/device-nrs.h
+++ b/sysdeps/unix/sysv/linux/device-nrs.h
@@ -35,8 +35,8 @@
#define DEV_TTY_HIGH_MAJOR 143
/* Test whether given device is a tty. */
-#define DEV_TTY_P(dev) \
- ({ int __dev_major = major (dev); \
+#define DEV_TTY_P(statp) \
+ ({ int __dev_major = major ((statp)->st_rdev); \
__dev_major >= DEV_TTY_LOW_MAJOR && __dev_major <= DEV_TTY_HIGH_MAJOR; })
#endif /* device-nrs.h */