[82236] users/pixilla/dports/sysutils/logrotate/files

pixilla at macports.org pixilla at macports.org
Wed Aug 10 22:44:24 PDT 2011


Revision: 82236
          http://trac.macports.org/changeset/82236
Author:   pixilla at macports.org
Date:     2011-08-10 22:44:24 -0700 (Wed, 10 Aug 2011)
Log Message:
-----------
sysutils/logrotate: Add mission strndup function.

Added Paths:
-----------
    users/pixilla/dports/sysutils/logrotate/files/patch-config.h.diff
    users/pixilla/dports/sysutils/logrotate/files/patch-strndup.c.diff
    users/pixilla/dports/sysutils/logrotate/files/patch-strndup.h.diff

Added: users/pixilla/dports/sysutils/logrotate/files/patch-config.h.diff
===================================================================
--- users/pixilla/dports/sysutils/logrotate/files/patch-config.h.diff	                        (rev 0)
+++ users/pixilla/dports/sysutils/logrotate/files/patch-config.h.diff	2011-08-11 05:44:24 UTC (rev 82236)
@@ -0,0 +1,10 @@
+--- a/config.h	2011-08-10 22:30:09.000000000 -0700
++++ b/config.h	2011-08-10 22:34:07.000000000 -0700
+@@ -47,3 +47,7 @@
+ #ifndef STATEFILE
+ #define STATEFILE "/var/lib/logrotate.status"
+ #endif
++
++#ifdef Darwin
++#include "strndup.h"
++#endif

Added: users/pixilla/dports/sysutils/logrotate/files/patch-strndup.c.diff
===================================================================
--- users/pixilla/dports/sysutils/logrotate/files/patch-strndup.c.diff	                        (rev 0)
+++ users/pixilla/dports/sysutils/logrotate/files/patch-strndup.c.diff	2011-08-11 05:44:24 UTC (rev 82236)
@@ -0,0 +1,41 @@
+--- /dev/null	2011-08-10 22:37:48.000000000 -0700
++++ b/strndup.c	2011-08-10 22:25:13.000000000 -0700
+@@ -0,0 +1,37 @@
++/* A replacement function, for systems that lack strndup.
++
++   Copyright (C) 1996, 1997, 1998, 2001, 2002, 2003, 2005, 2006, 2007
++   Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU General Public License as published by the
++   Free Software Foundation; either version 2, or (at your option) any
++   later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
++
++#include <config.h>
++
++#include <string.h>
++
++#include <stdlib.h>
++
++char *
++strndup (char const *s, size_t n)
++{
++  size_t len = strnlen (s, n);
++  char *new = malloc (len + 1);
++
++  if (new == NULL)
++    return NULL;
++
++  new[len] = '\0';
++  return memcpy (new, s, len);
++}
+\ No newline at end of file

Added: users/pixilla/dports/sysutils/logrotate/files/patch-strndup.h.diff
===================================================================
--- users/pixilla/dports/sysutils/logrotate/files/patch-strndup.h.diff	                        (rev 0)
+++ users/pixilla/dports/sysutils/logrotate/files/patch-strndup.h.diff	2011-08-11 05:44:24 UTC (rev 82236)
@@ -0,0 +1,4 @@
+--- /dev/null	2011-08-10 22:37:48.000000000 -0700
++++ b/strndup.h	2011-08-10 22:26:21.000000000 -0700
+@@ -0,0 +1 @@
++char *strndup (char const *s, size_t n);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110810/4a6b83a5/attachment-0001.html>


More information about the macports-changes mailing list