]> Pileus Git - ~andy/fetchmail/commitdiff
Remove even more cruft.
authorMatthias Andree <matthias.andree@gmx.de>
Thu, 1 Apr 2010 00:58:30 +0000 (02:58 +0200)
committerMatthias Andree <matthias.andree@gmx.de>
Sun, 12 Dec 2010 00:31:49 +0000 (01:31 +0100)
configure.ac
fetchmail.c
socket.c
xmalloc.c
xmalloc.h

index fe1a249be93c29839c42568223409519e95fea19..222cadcda971cddce5a67294bcf13309fc8489d9 100644 (file)
@@ -135,9 +135,7 @@ AC_CHECK_FUNC(getopt_long, [],
 
 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,
index 26e42f85aa06c926e4dfecb4e748da6588e36fc6..37e5f0ec8820aacb26d0d1e8b9f78b0a79b4d52b 100644 (file)
@@ -19,9 +19,7 @@
 #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() */
@@ -325,7 +323,6 @@ int main(int argc, char **argv)
     /* 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
@@ -338,7 +335,6 @@ int main(int argc, char **argv)
        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. */
index d0098ee86c3f52f9b2f9faa02d3fc15bc3ed55df..5ac2edcf911107d35f2f184ab5a9c5572c4cec0e 100644 (file)
--- a/socket.c
+++ b/socket.c
@@ -48,7 +48,6 @@ extern int h_errno;
 # endif
 #endif /* ndef h_errno */
 
-#ifdef HAVE_SOCKETPAIR
 static char *const *parse_plugin(const char *plugin, const char *host, const char *service)
 {
        char **argvec;
@@ -166,7 +165,6 @@ static int handle_plugin(const char *host,
     (void) close(fds[0]);
     return fds[1];
 }
-#endif /* HAVE_SOCKETPAIR */
 
 #ifdef __UNUSED__
 
@@ -235,10 +233,8 @@ int SockOpen(const char *host, const char *service,
     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;
index bcb625539765cbcd13aabf48fa29cf9671f8c5e8..00af14c80520bd9d9ed694726780280daedd456b 100644 (file)
--- a/xmalloc.c
+++ b/xmalloc.c
 #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();
@@ -34,13 +27,12 @@ xmalloc (size_t n)
     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();
@@ -56,17 +48,6 @@ char *xstrdup(const char *s)
     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;
@@ -79,4 +60,5 @@ char *xstrndup(const char *s, size_t len)
     return p;
 }
 
+
 /* xmalloc.c ends here */
index 818358285033195e1033b222188508468a32bb0a..3766043df0203473c303947ecbbe60dc88d49738 100644 (file)
--- a/xmalloc.h
+++ b/xmalloc.h
@@ -6,17 +6,12 @@
 #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; }