aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2017-11-07 19:08:06 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2017-11-07 19:08:06 +0000
commitd8dcc3a67dc8dca69d7f03f6e9a6f2bec141b103 (patch)
tree53bc9468f6bdd5acbf4ae55f2ebfda2493861dfa
parentfa97b067e1ca939729ecb7656835d4fcbc27915e (diff)
downloadgcc-d8dcc3a67dc8dca69d7f03f6e9a6f2bec141b103.zip
gcc-d8dcc3a67dc8dca69d7f03f6e9a6f2bec141b103.tar.gz
gcc-d8dcc3a67dc8dca69d7f03f6e9a6f2bec141b103.tar.bz2
Check for S_ISSOCK before use
* src/filesystem/ops-common.h (make_file_type) [S_ISSOCK]: Only use S_ISSOCK when defined. From-SVN: r254506
-rw-r--r--libstdc++-v3/ChangeLog5
-rw-r--r--libstdc++-v3/src/filesystem/ops-common.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index ea88034..0c5786b 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,8 @@
+2017-11-07 Jonathan Wakely <jwakely@redhat.com>
+
+ * src/filesystem/ops-common.h (make_file_type) [S_ISSOCK]: Only use
+ S_ISSOCK when defined.
+
2017-11-06 François Dumont <fdumont@gcc.gnu.org>
* testsuite/libstdc++-prettyprinters/tr1.cc: Compile with -O0.
diff --git a/libstdc++-v3/src/filesystem/ops-common.h b/libstdc++-v3/src/filesystem/ops-common.h
index 12c12b0..f96a999 100644
--- a/libstdc++-v3/src/filesystem/ops-common.h
+++ b/libstdc++-v3/src/filesystem/ops-common.h
@@ -113,9 +113,11 @@ _GLIBCXX_BEGIN_NAMESPACE_FILESYSTEM
return file_type::fifo;
else if (S_ISLNK(st.st_mode))
return file_type::symlink;
+#ifdef S_ISSOCK // not present until POSIX:2001
else if (S_ISSOCK(st.st_mode))
return file_type::socket;
#endif
+#endif
return file_type::unknown;
}