summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2012-08-30 19:01:22 +0200
committerAnand Avati <avati@redhat.com>2012-08-30 15:24:13 -0700
commitb10eea2c44272bf491b670466430f4a6d1ac364b (patch)
tree34f4d8aaad97de4f3521e8982aea3c9aadf1d3dd /contrib
parenta9ba00f5e4f9f00464c109bc41ec73725722f692 (diff)
Add missing contrib/libgen files to distribution
BUG: 764655 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Change-Id: I3f49eb4a1a186cb2d178539ada6a05c8c1aa8265 Reviewed-on: http://review.gluster.org/3882 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'contrib')
-rw-r--r--contrib/libgen/basename_r.c4
-rw-r--r--contrib/libgen/dirname_r.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/contrib/libgen/basename_r.c b/contrib/libgen/basename_r.c
index e3fae60..d63bce4 100644
--- a/contrib/libgen/basename_r.c
+++ b/contrib/libgen/basename_r.c
@@ -1,7 +1,10 @@
+#ifdef THREAD_UNSAFE_BASENAME
/*
* borrowed from glibc-2.12.1/string/basename.c
* Modified to return "." for NULL or "", as required for SUSv2.
*/
+#include <string.h>
+#include <stdlib.h>
/* Return the name-within-directory of a file name.
Copyright (C) 1996,97,98,2002 Free Software Foundation, Inc.
@@ -34,3 +37,4 @@ basename_r (filename)
p = strrchr (filename, '/');
return p ? p + 1 : (char *) filename;
}
+#endif /* THREAD_UNSAFE_BASENAME */
diff --git a/contrib/libgen/dirname_r.c b/contrib/libgen/dirname_r.c
index 78fe0ee..02981f5 100644
--- a/contrib/libgen/dirname_r.c
+++ b/contrib/libgen/dirname_r.c
@@ -1,9 +1,12 @@
+#ifdef THREAD_UNSAFE_DIRNAME
/*
* Borrowed from glibc-2.12.1/string/memrchr.c
* Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
* Removed code for long bigger than 32 bytes, renamed __ptr_t as void *
* changed reg_char type to char.
*/
+#include <string.h>
+#include <stdlib.h>
/* memrchr -- find the last occurrence of a byte in a memory block
Copyright (C) 1991, 93, 96, 97, 99, 2000 Free Software Foundation, Inc.
@@ -237,3 +240,4 @@ dirname_r (char *path)
return path;
}
+#endif /* THREAD_UNSAFE_DIRNAME */