diff options
author | Tobias Scherbaum <dertobi123@gentoo.org> | 2008-07-11 18:56:49 +0000 |
---|---|---|
committer | Tobias Scherbaum <dertobi123@gentoo.org> | 2008-07-11 18:56:49 +0000 |
commit | 3b8f511bd9eb3bced0f5a6b18a0f5fd0358a5ef6 (patch) | |
tree | ff3a2dd4126cc290a67596e011e64f34812ba1b3 /mail-mta/ssmtp/files | |
parent | amd64 stable (diff) | |
download | gentoo-2-3b8f511bd9eb3bced0f5a6b18a0f5fd0358a5ef6.tar.gz gentoo-2-3b8f511bd9eb3bced0f5a6b18a0f5fd0358a5ef6.tar.bz2 gentoo-2-3b8f511bd9eb3bced0f5a6b18a0f5fd0358a5ef6.zip |
strndup workaround for gfbsd, #227799
(Portage version: 2.2_rc1/cvs/Linux 2.6.25-gentoo-r6 x86_64)
Diffstat (limited to 'mail-mta/ssmtp/files')
-rw-r--r-- | mail-mta/ssmtp/files/ssmtp-2.62-strndup.patch | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/mail-mta/ssmtp/files/ssmtp-2.62-strndup.patch b/mail-mta/ssmtp/files/ssmtp-2.62-strndup.patch new file mode 100644 index 000000000000..a4434ebf08bb --- /dev/null +++ b/mail-mta/ssmtp/files/ssmtp-2.62-strndup.patch @@ -0,0 +1,32 @@ +Compensate for platforms that don't have strndup, like Solaris + +--- configure.in ++++ configure.in +@@ -30,7 +30,7 @@ + dnl Checks for library functions. + AC_TYPE_SIGNAL + AC_FUNC_VPRINTF +-AC_CHECK_FUNCS(gethostname socket strdup strstr) ++AC_CHECK_FUNCS(gethostname socket strdup strndup strstr) + + dnl Check for optional features + AC_ARG_ENABLE(logfile, +--- ssmtp.c ++++ ssmtp.c +@@ -842,7 +842,16 @@ + if (!rest) { + return NULL; + } ++#ifdef HAVE_STRNDUP + tok=strndup(*s,rest-(*s)); ++#else ++ { ++ size_t len = rest - (*s); ++ tok = malloc(sizeof(char) * (len + 1)); ++ memcpy(tok, *s, len); ++ tok[len] = '\0'; ++ } ++#endif + if (!tok) { + die("firsttok() -- strndup() failed"); + } |