Skip to content

Commit

Permalink
mktemp: warning fix for x86 and l-preview
Browse files Browse the repository at this point in the history
mktemp is almost not used in busybox, so rename
the function in the mktemp applet to prevent bionic
warning on include.

Change-Id: I4332d3b957aafd6174eb7fe098b099eae779d3c9
  • Loading branch information
tpruvot committed Aug 6, 2014
1 parent 3ae2578 commit 9d67376
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
2 changes: 0 additions & 2 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ LOCAL_C_INCLUDES := $(bb_gen)/minimal/include $(BUSYBOX_C_INCLUDES)
LOCAL_CFLAGS := -Dmain=busybox_driver $(BUSYBOX_CFLAGS)
LOCAL_CFLAGS += \
-DRECOVERY_VERSION \
-Dmktemp=busybox_mktemp \
-Dgetusershell=busybox_getusershell \
-Dsetusershell=busybox_setusershell \
-Dendusershell=busybox_endusershell \
Expand Down Expand Up @@ -225,7 +224,6 @@ LOCAL_SRC_FILES := $(BUSYBOX_SRC_FILES)
LOCAL_C_INCLUDES := $(bb_gen)/full/include $(BUSYBOX_C_INCLUDES)
LOCAL_CFLAGS := $(BUSYBOX_CFLAGS)
LOCAL_CFLAGS += \
-Dmktemp=busybox_mktemp \
-Dgetusershell=busybox_getusershell \
-Dsetusershell=busybox_setusershell \
-Dendusershell=busybox_endusershell \
Expand Down
2 changes: 1 addition & 1 deletion android/libc/mktemp.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ _mktemp(char *path)
}

char *
mktemp(char *path)
bb_mktemp(char *path)
{
return (_mktemp(path));
}
Expand Down
4 changes: 4 additions & 0 deletions debianutils/mktemp.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@

#include "libbb.h"

#ifdef __BIONIC__
#define mktemp(s) bb_mktemp(s)
#endif

int mktemp_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int mktemp_main(int argc UNUSED_PARAM, char **argv)
{
Expand Down
1 change: 1 addition & 0 deletions include/android.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ void endutent(void);

/* defined in bionic/mktemp.c */
char *mkdtemp(char *);
char *bb_mktemp(char *);

/* SYSCALLS */
int stime(time_t *);
Expand Down
3 changes: 3 additions & 0 deletions libbb/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ void* FAST_FUNC memrchr(const void *s, int c, size_t n)
#endif

#ifndef HAVE_MKDTEMP
#ifdef __BIONIC__
#define mktemp(s) bb_mktemp(s)
#endif
/* This is now actually part of POSIX.1, but was only added in 2008 */
char* FAST_FUNC mkdtemp(char *template)
{
Expand Down

0 comments on commit 9d67376

Please sign in to comment.