oslib/strndup: cleanup and remember to include for aux programs
authorJens Axboe <axboe@kernel.dk>
Thu, 8 Jun 2017 16:07:55 +0000 (10:07 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 8 Jun 2017 16:07:55 +0000 (10:07 -0600)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Makefile
oslib/strndup.c
oslib/strndup.h

index a412a43b0f70b0437e3eb89f781a62562be203ac..d7786d2bea27956e28e57323fcc165090c64a173 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -212,7 +212,8 @@ T_IEEE_PROGS = t/ieee754
 
 T_ZIPF_OBS = t/genzipf.o
 T_ZIPF_OBJS += t/log.o lib/ieee754.o lib/rand.o lib/pattern.o lib/zipf.o \
 
 T_ZIPF_OBS = t/genzipf.o
 T_ZIPF_OBJS += t/log.o lib/ieee754.o lib/rand.o lib/pattern.o lib/zipf.o \
-               lib/strntol.o lib/gauss.o t/genzipf.o oslib/strcasestr.o
+               lib/strntol.o lib/gauss.o t/genzipf.o oslib/strcasestr.o \
+               oslib/strndup.o
 T_ZIPF_PROGS = t/fio-genzipf
 
 T_AXMAP_OBJS = t/axmap.o
 T_ZIPF_PROGS = t/fio-genzipf
 
 T_AXMAP_OBJS = t/axmap.o
@@ -225,7 +226,7 @@ T_LFSR_TEST_PROGS = t/lfsr-test
 
 T_GEN_RAND_OBJS = t/gen-rand.o
 T_GEN_RAND_OBJS += t/log.o t/debug.o lib/rand.o lib/pattern.o lib/strntol.o \
 
 T_GEN_RAND_OBJS = t/gen-rand.o
 T_GEN_RAND_OBJS += t/log.o t/debug.o lib/rand.o lib/pattern.o lib/strntol.o \
-                       oslib/strcasestr.o
+                       oslib/strcasestr.o oslib/strndup.o
 T_GEN_RAND_PROGS = t/gen-rand
 
 ifeq ($(CONFIG_TARGET_OS), Linux)
 T_GEN_RAND_PROGS = t/gen-rand
 
 ifeq ($(CONFIG_TARGET_OS), Linux)
index 318ca933d54b0e5e4cdb09dc32d69ec5f7f0ab8b..7b0fcb516163d29eec0592cb31c867da37b66a09 100644 (file)
@@ -1,5 +1,5 @@
 #include <stdlib.h>
 #include <stdlib.h>
-#include <string.h>
+#include "strndup.h"
 
 #ifndef CONFIG_HAVE_STRNDUP
 
 
 #ifndef CONFIG_HAVE_STRNDUP
 
index 669364e435c210ad26090f8129e7a20ae637d712..2cb904dab0b76448c59172f80084b9a96075d023 100644 (file)
@@ -1,8 +1,6 @@
-#ifdef CONFIG_HAVE_STRNDUP
-
 #include <string.h>
 
 #include <string.h>
 
-#else
+#ifndef CONFIG_HAVE_STRNDUP
 
 char *strndup(const char *s, size_t n);
 
 
 char *strndup(const char *s, size_t n);