From c59166c5a3306231864fe7d99e383259a9385233 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Tue, 14 May 2013 11:59:20 +0530 Subject: glusterfs: add gf_mkostemp api and use it instead of mkostemp of libc Change-Id: Ia3d2f37ae1f7a7d87a75c82bedb4963729d45b6c BUG: 764890 Signed-off-by: Raghavendra Bhat Reviewed-on: http://review.gluster.org/5004 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- libglusterfs/src/Makefile.am | 3 ++- libglusterfs/src/compat.h | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'libglusterfs') diff --git a/libglusterfs/src/Makefile.am b/libglusterfs/src/Makefile.am index d708f98d205..ac1a9f58e21 100644 --- a/libglusterfs/src/Makefile.am +++ b/libglusterfs/src/Makefile.am @@ -24,7 +24,8 @@ libglusterfs_la_SOURCES = dict.c xlator.c logging.c \ $(CONTRIBDIR)/uuid/isnull.c $(CONTRIBDIR)/uuid/unpack.c syncop.c \ graph-print.c trie.c run.c options.c fd-lk.c circ-buff.c \ event-history.c \ - $(CONTRIBDIR)/libgen/basename_r.c $(CONTRIBDIR)/libgen/dirname_r.c + $(CONTRIBDIR)/libgen/basename_r.c $(CONTRIBDIR)/libgen/dirname_r.c \ + $(CONTRIBDIR)/stdlib/gf_mkostemp.c nodist_libglusterfs_la_SOURCES = y.tab.c graph.lex.c diff --git a/libglusterfs/src/compat.h b/libglusterfs/src/compat.h index af890485df5..3d0cee1a986 100644 --- a/libglusterfs/src/compat.h +++ b/libglusterfs/src/compat.h @@ -344,6 +344,9 @@ char *dirname_r(char *path); #define dirname(path) dirname_r(path) #endif /* THREAD_UNSAFE_DIRNAME */ +int gf_mkostemp (char *tmpl, int suffixlen, int flags); +#define mkostemp(tmpl, flags) gf_mkostemp(tmpl, 0, flags); + #ifdef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC /* Linux, Solaris, Cygwin */ #define ST_ATIM_NSEC(stbuf) ((stbuf)->st_atim.tv_nsec) -- cgit