aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Rees <utisoft@gmail.com>2011-01-24 17:03:36 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2011-01-24 17:04:59 +0100
commite3c127d846eb2febbdb86bcf6c0c92622ab98eea (patch)
treec3d4458c20e13cce49bf049efee798de650eadab
parent271c0ce379be4b59d28e17f4774f5a078e77f64b (diff)
downloadbusybox-w32-e3c127d846eb2febbdb86bcf6c0c92622ab98eea.tar.gz
busybox-w32-e3c127d846eb2febbdb86bcf6c0c92622ab98eea.tar.bz2
busybox-w32-e3c127d846eb2febbdb86bcf6c0c92622ab98eea.zip
FreeBSD compat
Signed-off-by: Chris Rees <utisoft@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--include/libbb.h6
-rw-r--r--include/platform.h6
-rw-r--r--libbb/getpty.c2
3 files changed, 13 insertions, 1 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 6e37b8d04..aa7944a5d 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -38,6 +38,12 @@
38#include <time.h> 38#include <time.h>
39#include <unistd.h> 39#include <unistd.h>
40#include <sys/param.h> 40#include <sys/param.h>
41#ifndef HAVE_CLEARENV
42# define clearenv() do { if (environ) environ[0] = NULL; } while (0)
43#endif
44#ifndef HAVE_FDATASYNC
45# define fdatasync fsync
46#endif
41#ifdef HAVE_MNTENT_H 47#ifdef HAVE_MNTENT_H
42# include <mntent.h> 48# include <mntent.h>
43#endif 49#endif
diff --git a/include/platform.h b/include/platform.h
index bbbc0a9b6..2bc88c391 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -10,9 +10,12 @@
10/* Assume all these functions exist by default. Platforms where it is not 10/* Assume all these functions exist by default. Platforms where it is not
11 * true will #undef them below. 11 * true will #undef them below.
12 */ 12 */
13#define HAVE_CLEARENV 1
14#define HAVE_FDATASYNC 1
13#define HAVE_FDPRINTF 1 15#define HAVE_FDPRINTF 1
14#define HAVE_MEMRCHR 1 16#define HAVE_MEMRCHR 1
15#define HAVE_MKDTEMP 1 17#define HAVE_MKDTEMP 1
18#define HAVE_PTSNAME_R 1
16#define HAVE_SETBIT 1 19#define HAVE_SETBIT 1
17#define HAVE_SIGHANDLER_T 1 20#define HAVE_SIGHANDLER_T 1
18#define HAVE_STRCASESTR 1 21#define HAVE_STRCASESTR 1
@@ -253,7 +256,10 @@ typedef uint32_t bb__aliased_uint32_t FIX_ALIASING;
253#if (defined __digital__ && defined __unix__) \ 256#if (defined __digital__ && defined __unix__) \
254 || defined __APPLE__ \ 257 || defined __APPLE__ \
255 || defined __FreeBSD__ || defined __OpenBSD__ || defined __NetBSD__ 258 || defined __FreeBSD__ || defined __OpenBSD__ || defined __NetBSD__
259# undef HAVE_CLEARENV
260# undef HAVE_FDATASYNC
256# undef HAVE_MNTENT_H 261# undef HAVE_MNTENT_H
262# undef HAVE_PTSNAME_R
257# undef HAVE_SYS_STATFS_H 263# undef HAVE_SYS_STATFS_H
258# undef HAVE_SIGHANDLER_T 264# undef HAVE_SIGHANDLER_T
259#else 265#else
diff --git a/libbb/getpty.c b/libbb/getpty.c
index ea653b0b6..6a15cff2f 100644
--- a/libbb/getpty.c
+++ b/libbb/getpty.c
@@ -19,7 +19,7 @@ int FAST_FUNC xgetpty(char *line)
19 if (p > 0) { 19 if (p > 0) {
20 grantpt(p); /* chmod+chown corresponding slave pty */ 20 grantpt(p); /* chmod+chown corresponding slave pty */
21 unlockpt(p); /* (what does this do?) */ 21 unlockpt(p); /* (what does this do?) */
22#if 0 /* if ptsname_r is not available... */ 22#ifndef HAVE_PTSNAME_R
23 const char *name; 23 const char *name;
24 name = ptsname(p); /* find out the name of slave pty */ 24 name = ptsname(p); /* find out the name of slave pty */
25 if (!name) { 25 if (!name) {