diff options
author | 2006-09-25 20:43:35 +0000 | |
---|---|---|
committer | 2006-09-25 20:43:35 +0000 | |
commit | 4308924b1a27ae0906f7474eb4eda5d2a1469a2d (patch) | |
tree | 4e0c485c0b4f0b76b8aeed60f16f9810b2e225ba | |
parent | Move llrint.c, llrintf.c, lrint.c and lrintf.c to s_llrint.c, s_llrintf.c, (diff) | |
download | wireguard-openbsd-4308924b1a27ae0906f7474eb4eda5d2a1469a2d.tar.xz wireguard-openbsd-4308924b1a27ae0906f7474eb4eda5d2a1469a2d.zip |
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@
-rw-r--r-- | gnu/usr.bin/binutils/gdb/remote-fileio.c | 6 |
1 files changed, 3 insertions, 3 deletions
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; |