Commit 1656152d authored by Evan Hunt's avatar Evan Hunt Committed by Ondřej Surý
Browse files

Ensure that POSIX strerror_r variant is use even when _GNU_SOURCE is enabled by default

parent cacd21c0
Pipeline #4345 passed with stages
in 9 minutes and 53 seconds
......@@ -40,6 +40,7 @@
#include <isc/print.h>
#include <isc/resource.h>
#include <isc/result.h>
#include <isc/strerr.h>
#include <isc/string.h>
#include <named/globals.h>
......
......@@ -33,6 +33,7 @@
#include <isc/netaddr.h>
#include <isc/print.h>
#include <isc/result.h>
#include <isc/strerr.h>
#include <isc/string.h>
#include <isc/util.h>
......
......@@ -29,6 +29,7 @@
#include <isc/serial.h>
#include <isc/stats.h>
#include <isc/stdtime.h>
#include <isc/strerr.h>
#include <isc/string.h>
#include <isc/taskpool.h>
#include <isc/thread.h>
......
......@@ -32,7 +32,7 @@ HEADERS = aes.h app.h assertions.h atomic.h backtrace.h base32.h base64.h \
radix.h random.h ratelimiter.h refcount.h regex.h \
region.h resource.h result.h resultclass.h rwlock.h \
safe.h serial.h sha1.h sha2.h sockaddr.h socket.h \
stats.h stdio.h stdlib.h string.h symtab.h \
stats.h stdio.h stdlib.h strerr.h string.h symtab.h \
task.h taskpool.h timer.h tm.h types.h util.h version.h \
xml.h
......
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
#pragma once
/*! \file isc/strerr.h */
#include <config.h>
#include <string.h>
#if _GNU_SOURCE
#undef strerror_r
#define strerror_r isc_string_strerror_r
#endif
......@@ -34,4 +34,7 @@ isc_string_strlcat(char *dst, const char *src, size_t size);
#define strlcat isc_string_strlcat
#endif
int
isc_string_strerror_r(int errnum, char *buf, size_t buflen);
ISC_LANG_ENDDECLS
......@@ -18,6 +18,7 @@
#include <isc/condition.h>
#include <isc/msgs.h>
#include <isc/strerr.h>
#include <isc/string.h>
#include <isc/time.h>
#include <isc/util.h>
......
......@@ -16,7 +16,6 @@
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <sys/time.h>
#include <errno.h>
......@@ -24,6 +23,8 @@
#include <isc/mutex.h>
#include <isc/util.h>
#include <isc/print.h>
#include <isc/strerr.h>
#include <isc/string.h>
#include <isc/once.h>
#if ISC_MUTEX_PROFILE
......
......@@ -42,7 +42,10 @@
#include <config.h> // IWYU pragma: keep
#ifdef _GNU_SOURCE
#undef _GNU_SOURCE
#include <string.h>
#endif
#include "isc/string.h" // IWYU pragma: keep
......@@ -103,3 +106,8 @@ isc_string_strlcat(char *dst, const char *src, size_t size)
return(dlen + (s - src)); /* count does not include NUL */
}
int
isc_string_strerror_r(int errnum, char *buf, size_t buflen) {
return (strerror_r(errnum, buf, buflen));
}
......@@ -36,6 +36,7 @@
#include <isc/mutex.h>
#include <isc/event.h>
#include <isc/platform.h>
#include <isc/strerr.h>
#include <isc/string.h>
#include <isc/task.h>
#include <isc/time.h>
......
......@@ -15,10 +15,11 @@
#include <config.h>
#include <stdbool.h>
#include <string.h>
#include <isc/platform.h>
#include <isc/result.h>
#include <isc/strerr.h>
#include <isc/string.h>
#include <isc/util.h>
#include "errno2result.h"
......
......@@ -34,6 +34,7 @@
#include <isc/net.h>
#include <isc/print.h>
#include <isc/result.h>
#include <isc/strerr.h>
#include <isc/string.h>
#include <isc/types.h>
#include <isc/util.h>
......
......@@ -32,6 +32,7 @@
#include <isc/net.h>
#include <isc/netdb.h>
#include <isc/once.h>
#include <isc/strerr.h>
#include <isc/string.h>
#include <isc/util.h>
......
......@@ -35,7 +35,6 @@
#include <fcntl.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <isc/buffer.h>
......@@ -56,6 +55,7 @@
#include <isc/resource.h>
#include <isc/socket.h>
#include <isc/stats.h>
#include <isc/strerr.h>
#include <isc/string.h>
#include <isc/task.h>
#include <isc/thread.h>
......
......@@ -27,6 +27,7 @@
#include <isc/log.h>
#include <isc/platform.h>
#include <isc/print.h>
#include <isc/strerr.h>
#include <isc/string.h>
#include <isc/time.h>
#include <isc/tm.h>
......
......@@ -17,7 +17,7 @@
#include "errno2result.h"
#include <isc/result.h>
#include <isc/strerror.h>
#include <isc/string.h>
#include <isc/util.h>
/*
......
......@@ -29,6 +29,7 @@
#include <isc/mem.h>
#include <isc/print.h>
#include <isc/result.h>
#include <isc/strerr.h>
#include <isc/string.h>
#include <isc/strerror.h>
#include <isc/types.h>
......
......@@ -614,6 +614,7 @@ isc_stdio_sync
isc_stdio_tell
isc_stdio_write
isc_stdtime_get
isc_string_strerror_r
isc_string_strlcat
isc_string_strlcpy
isc_symtab_count
......
......@@ -245,6 +245,9 @@
<ClInclude Include="..\include\isc\stdlib.h">
<Filter>Library Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\isc\strerr.h">
<Filter>Library Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\isc\string.h">
<Filter>Library Header Files</Filter>
</ClInclude>
......
......@@ -363,6 +363,7 @@ copy InstallFiles ..\Build\Release\
<ClInclude Include="..\include\isc\stats.h" />
<ClInclude Include="..\include\isc\stdio.h" />
<ClInclude Include="..\include\isc\stdlib.h" />
<ClInclude Include="..\include\isc\strerr.h" />
<ClInclude Include="..\include\isc\string.h" />
<ClInclude Include="..\include\isc\symtab.h" />
<ClInclude Include="..\include\isc\task.h" />
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment