]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Check for S_ISSOCK before use
authorJonathan Wakely <jwakely@redhat.com>
Tue, 7 Nov 2017 19:08:06 +0000 (19:08 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 7 Nov 2017 19:08:06 +0000 (19:08 +0000)
* src/filesystem/ops-common.h (make_file_type) [S_ISSOCK]: Only use
S_ISSOCK when defined.

From-SVN: r254506

libstdc++-v3/ChangeLog
libstdc++-v3/src/filesystem/ops-common.h

index ea88034c9826d3eec17d73aaecbfe6fe406128c5..0c5786b1f961d226188352b5d57bbbfb45759b90 100644 (file)
@@ -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.
index 12c12b08f8c50eaa1ca8dc006062f4f13b566ec4..f96a999264f74e0af6f3405cbba23723c5eb154a 100644 (file)
@@ -113,8 +113,10 @@ _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;
   }