AC_SUBST(EXTRAOBJ)
-AC_CHECK_FUNCS(vsyslog dnl
- inet_aton setrlimit socketpair dnl
- sigaction strdup setlocale)
+AC_CHECK_FUNCS(vsyslog inet_aton)
dnl INET6 is used by KAME/getnameinfo
AC_CACHE_CHECK(for AF_INET6/PF_INET6,ac_cv_inet6,
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
-#ifdef HAVE_SETRLIMIT
#include <sys/resource.h>
-#endif /* HAVE_SETRLIMIT */
#ifdef HAVE_SOCKS
#include <socks.h> /* SOCKSinit() */
/* construct the lockfile */
fm_lock_setup(&run);
-#ifdef HAVE_SETRLIMIT
/*
* Before getting passwords, disable core dumps unless -v -d0 mode is on.
* Core dumps could otherwise contain passwords to be scavenged by a
corelimit.rlim_max = 0;
setrlimit(RLIMIT_CORE, &corelimit);
}
-#endif /* HAVE_SETRLIMIT */
#define NETRC_FILE ".netrc"
/* parse the ~/.netrc file (if present) for future password lookups. */
# endif
#endif /* ndef h_errno */
-#ifdef HAVE_SOCKETPAIR
static char *const *parse_plugin(const char *plugin, const char *host, const char *service)
{
char **argvec;
(void) close(fds[0]);
return fds[1];
}
-#endif /* HAVE_SOCKETPAIR */
#ifdef __UNUSED__
int ord;
char errbuf[8192] = "";
-#ifdef HAVE_SOCKETPAIR
if (plugin)
return handle_plugin(host,service,plugin);
-#endif /* HAVE_SOCKETPAIR */
memset(&req, 0, sizeof(struct addrinfo));
req.ai_socktype = SOCK_STREAM;
#include "fetchmail.h"
#include "i18n.h"
-#if defined(HAVE_VOIDPOINTER)
-#define XMALLOCTYPE void
-#else
-#define XMALLOCTYPE char
-#endif
-
-XMALLOCTYPE *
-xmalloc (size_t n)
+void *xmalloc (size_t n)
{
- XMALLOCTYPE *p;
+ void *p;
- p = (XMALLOCTYPE *) malloc(n);
- if (p == (XMALLOCTYPE *) 0)
+ p = (void *) malloc(n);
+ if (p == (void *) 0)
{
report(stderr, GT_("malloc failed\n"));
abort();
return(p);
}
-XMALLOCTYPE *
-xrealloc (XMALLOCTYPE *p, size_t n)
+void *xrealloc (void *p, size_t n)
{
if (p == 0)
return xmalloc (n);
- p = (XMALLOCTYPE *) realloc(p, n);
- if (p == (XMALLOCTYPE *) 0)
+ p = (void *) realloc(p, n);
+ if (p == (void *) 0)
{
report(stderr, GT_("realloc failed\n"));
abort();
return p;
}
-#if !defined(HAVE_STRDUP)
-char *strdup(const char *s)
-{
- char *p;
- p = (char *) malloc(strlen(s)+1);
- if (p)
- strcpy(p,s);
- return p;
-}
-#endif /* !HAVE_STRDUP */
-
char *xstrndup(const char *s, size_t len)
{
char *p;
return p;
}
+
/* xmalloc.c ends here */
#include "config.h"
/* xmalloc.c */
-#if defined(HAVE_VOIDPOINTER)
-#define XMALLOCTYPE void
-#else
-#define XMALLOCTYPE char
-#endif
/** Allocate \a n characters of memory, abort program on failure. */
-XMALLOCTYPE *xmalloc(size_t n);
+void *xmalloc(size_t n);
/** Reallocate \a n characters of memory, abort program on failure. */
-XMALLOCTYPE *xrealloc(/*@null@*/ XMALLOCTYPE *, size_t n);
+void *xrealloc(/*@null@*/ void *, size_t n);
/** Free memory at position \a p and set pointer \a p to NULL afterwards. */
#define xfree(p) { if (p) { free(p); } (p) = 0; }