From 6f2b5e015d3daa3d20ff97d02e7bc7e9064a183e Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Mon, 25 Sep 2006 20:43:36 +0000 Subject: Use S_IS* macros insted of masking with S_IF* flags. The latter may have multiple bits set, which lead to surprising results. Spotted by Paul Stoeber. ok kettenis@ --- gnu/usr.bin/binutils/gdb/remote-fileio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gnu/usr.bin') diff --git a/gnu/usr.bin/binutils/gdb/remote-fileio.c b/gnu/usr.bin/binutils/gdb/remote-fileio.c index 281872ec6c0..4593ac0cf08 100644 --- a/gnu/usr.bin/binutils/gdb/remote-fileio.c +++ b/gnu/usr.bin/binutils/gdb/remote-fileio.c @@ -181,11 +181,11 @@ remote_fileio_mode_to_target (mode_t mode) { mode_t tmode = 0; - if (mode & S_IFREG) + if (S_ISREG(mode)) tmode |= FILEIO_S_IFREG; - if (mode & S_IFDIR) + if (S_ISDIR(mode)) tmode |= FILEIO_S_IFDIR; - if (mode & S_IFCHR) + if (S_ISCHR(mode)) tmode |= FILEIO_S_IFCHR; if (mode & S_IRUSR) tmode |= FILEIO_S_IRUSR; -- cgit v1.2.3