2503. [port] linux: improve compatibility with Linux Standard

Base. [RT #18793]
This commit is contained in:
Mark Andrews
2009-02-16 00:53:58 +00:00
parent fc12220bab
commit ec281e5d51
11 changed files with 51 additions and 45 deletions
+3 -1
View File
@@ -31,7 +31,7 @@
/*
* Principal Author: Brian Wellington
* $Id: dst_api.c,v 1.11.92.3 2008/11/14 22:57:29 marka Exp $
* $Id: dst_api.c,v 1.11.92.4 2009/02/16 00:53:58 marka Exp $
*/
/*! \file */
@@ -125,6 +125,7 @@ static isc_result_t addsuffix(char *filename, unsigned int len,
return (_r); \
} while (0); \
#ifdef OPENSSL
static void *
default_memalloc(void *arg, size_t size) {
UNUSED(arg);
@@ -138,6 +139,7 @@ default_memfree(void *arg, void *ptr) {
UNUSED(arg);
free(ptr);
}
#endif
isc_result_t
dst_lib_init(isc_mem_t *mctx, isc_entropy_t *ectx, unsigned int eflags) {
+3 -3
View File
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
# $Id: Makefile.in,v 1.93.58.4 2009/01/29 23:47:13 tbox Exp $
# $Id: Makefile.in,v 1.93.58.5 2009/02/16 00:53:58 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
@@ -54,7 +54,7 @@ OBJS = @ISC_EXTRA_OBJS@ \
assertions.@O@ base64.@O@ bitstring.@O@ buffer.@O@ \
bufferlist.@O@ commandline.@O@ error.@O@ event.@O@ \
hash.@O@ heap.@O@ hex.@O@ hmacmd5.@O@ hmacsha.@O@ \
httpd.@O@ \
httpd.@O@ inet_aton.@O@ \
lex.@O@ lfsr.@O@ lib.@O@ log.@O@ \
md5.@O@ mem.@O@ mutexblock.@O@ \
netaddr.@O@ netscope.@O@ ondestroy.@O@ \
@@ -69,7 +69,7 @@ SRCS = @ISC_EXTRA_SRCS@ \
assertions.c base64.c bitstring.c buffer.c \
bufferlist.c commandline.c error.c event.c \
heap.c hex.c hmacmd5.c hmacsha.c \
httpd.c \
httpd.c inet_aton.c \
lex.c lfsr.c lib.c log.c \
md5.c mem.c mutexblock.c \
netaddr.c netscope.c ondestroy.c \
+1 -6
View File
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: platform.h.in,v 1.45.60.3 2008/06/24 00:09:12 jinmei Exp $ */
/* $Id: platform.h.in,v 1.45.60.4 2009/02/16 00:53:58 marka Exp $ */
#ifndef ISC_PLATFORM_H
#define ISC_PLATFORM_H 1
@@ -93,11 +93,6 @@
*/
@ISC_PLATFORM_NEEDPTON@
/*! \brief
* If this system needs inet_aton(), ISC_PLATFORM_NEEDATON will be defined.
*/
@ISC_PLATFORM_NEEDATON@
/*! \brief
* If this system needs in_port_t, ISC_PLATFORM_NEEDPORTT will be defined.
*/
+5 -1
View File
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dir.c,v 1.25 2007/06/19 23:47:18 tbox Exp $ */
/* $Id: dir.c,v 1.25.128.1 2009/02/16 00:53:58 marka Exp $ */
/*! \file
* \author Principal Authors: DCL */
@@ -171,10 +171,14 @@ isc_dir_chroot(const char *dirname) {
REQUIRE(dirname != NULL);
#ifdef HAVE_CHROOT
if (chroot(dirname) < 0)
return (isc__errno2result(errno));
return (ISC_R_SUCCESS);
#else
return (ISC_R_NOTIMPLEMENTED);
#endif
}
isc_result_t
+12 -1
View File
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: entropy.c,v 1.80 2007/06/19 23:47:18 tbox Exp $ */
/* $Id: entropy.c,v 1.80.128.1 2009/02/16 00:53:58 marka Exp $ */
/* \file unix/entropy.c
* \brief
@@ -31,6 +31,9 @@
#include <sys/socket.h>
#include <sys/un.h>
#ifdef HAVE_NANOSLEEP
#include <time.h>
#endif
#include <unistd.h>
#include <isc/platform.h>
@@ -174,7 +177,15 @@ get_from_usocketsource(isc_entropysource_t *source, isc_uint32_t desired) {
* just "break", then the "desired"
* amount gets borked.
*/
#ifdef HAVE_NANOSLEEP
struct timespec ts;
ts.tv_sec = 0;
ts.tv_nsec = 1000000;
nanosleep(&ts, NULL);
#else
usleep(1000);
#endif
goto eagain_loop;
}
if (errno == EWOULDBLOCK || errno == EINTR)
+3 -3
View File
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: ifiter_ioctl.c,v 1.58.90.2 2009/01/19 23:47:03 tbox Exp $ */
/* $Id: ifiter_ioctl.c,v 1.58.90.3 2009/02/16 00:53:58 marka Exp $ */
/*! \file
* \brief
@@ -479,8 +479,8 @@ linux_if_inet6_current(isc_interfaceiter_t *iter) {
for (i = 0; i < 16; i++) {
unsigned char byte;
static const char hex[] = "0123456789abcdef";
byte = ((index(hex, address[i * 2]) - hex) << 4) |
(index(hex, address[i * 2 + 1]) - hex);
byte = ((strchr(hex, address[i * 2]) - hex) << 4) |
(strchr(hex, address[i * 2 + 1]) - hex);
addr6.s6_addr[i] = byte;
}
iter->current.af = AF_INET6;
+1 -3
View File
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: net.h,v 1.46.128.2 2008/06/24 23:46:27 tbox Exp $ */
/* $Id: net.h,v 1.46.128.3 2009/02/16 00:53:58 marka Exp $ */
#ifndef ISC_NET_H
#define ISC_NET_H 1
@@ -354,11 +354,9 @@ isc_net_pton(int af, const char *src, void *dst);
#define inet_pton isc_net_pton
#endif
#ifdef ISC_PLATFORM_NEEDATON
int
isc_net_aton(const char *cp, struct in_addr *addr);
#define inet_aton isc_net_aton
#endif
ISC_LANG_ENDDECLS