This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [libstdc++-v3] Add configure check for S_ISSOCK
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: Andris Pavenis <andris dot pavenis at iki dot fi>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, libstdc++ at gcc dot gnu dot org, DJ Delorie <dj at delorie dot com>
- Date: Tue, 7 Nov 2017 18:28:20 +0000
- Subject: Re: [libstdc++-v3] Add configure check for S_ISSOCK
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jwakely at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E4A6160177
- References: <bf50830b-939a-6acf-80f8-d27ccd8df3d5@iki.fi>
On 07/11/17 19:26 +0200, Andris Pavenis wrote:
src/filesystem/ops-common.c uses S_ISSOCK unconditionally without checking that it is available
As result compile fails for DJGPP when S_ISREG is available but
S_ISSOCK is not. Included patch add configure check for S_ISSOCK
Andris
ChangeLog entry:
2017-11-07 Andris Pavenis<andris.pavenis.iki.fi>
* acinclude.m4 (GLIBCXX_CHECK_S_ISSOCK): Define
* configure.ac: Check presence of S_ISSOCK
* src/filesystem/ops-common.h: Only use S_ISSOCK if defined for target
* config.h.in: Regenerate
* configure: Regenerate
Do we need an autoconf check?
commit 9d7fc666f031731cc5657b54e8dc39c81a28984f
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Tue Nov 7 18:19:10 2017 +0000
Check for S_ISSOCK before use
* src/filesystem/ops-common.h (make_file_type) [S_ISSOCK]: Only use
S_ISSOCK when defined.
diff --git a/libstdc++-v3/src/filesystem/ops-common.h b/libstdc++-v3/src/filesystem/ops-common.h
index 12c12b08f8c..5b947287d7f 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
else if (S_ISSOCK(st.st_mode))
return file_type::socket;
#endif
+#endif
return file_type::unknown;
}