aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-04-17 23:14:19 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2011-04-17 23:14:19 +0200
commit47061b4e9b5b7e5d1f27eb7fb83f6721c94b0986 (patch)
tree589315ac63e416193baf4d5dbc613a5942512144
parent0288b27ad870adc437c370c262b7b41990ae0118 (diff)
downloadbusybox-w32-47061b4e9b5b7e5d1f27eb7fb83f6721c94b0986.tar.gz
busybox-w32-47061b4e9b5b7e5d1f27eb7fb83f6721c94b0986.tar.bz2
busybox-w32-47061b4e9b5b7e5d1f27eb7fb83f6721c94b0986.zip
straighten out dprintf/fdprintf mess; remove old "define lchown chown"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--include/platform.h19
-rw-r--r--libbb/platform.c6
2 files changed, 9 insertions, 16 deletions
diff --git a/include/platform.h b/include/platform.h
index e390e58e2..2b57cd5a2 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -12,7 +12,7 @@
12 */ 12 */
13#define HAVE_CLEARENV 1 13#define HAVE_CLEARENV 1
14#define HAVE_FDATASYNC 1 14#define HAVE_FDATASYNC 1
15#define HAVE_FDPRINTF 1 15#define HAVE_DPRINTF 1
16#define HAVE_MEMRCHR 1 16#define HAVE_MEMRCHR 1
17#define HAVE_MKDTEMP 1 17#define HAVE_MKDTEMP 1
18#define HAVE_PTSNAME_R 1 18#define HAVE_PTSNAME_R 1
@@ -264,7 +264,7 @@ typedef uint32_t bb__aliased_uint32_t FIX_ALIASING;
264# undef HAVE_SYS_STATFS_H 264# undef HAVE_SYS_STATFS_H
265# undef HAVE_SIGHANDLER_T 265# undef HAVE_SIGHANDLER_T
266# undef HAVE_XTABS 266# undef HAVE_XTABS
267# undef HAVE_FDPRINTF 267# undef HAVE_DPRINTF
268#else 268#else
269# define HAVE_MNTENT_H 1 269# define HAVE_MNTENT_H 1
270# define HAVE_SYS_STATFS_H 1 270# define HAVE_SYS_STATFS_H 1
@@ -332,11 +332,6 @@ typedef unsigned smalluint;
332# define USE_FOR_MMU(...) __VA_ARGS__ 332# define USE_FOR_MMU(...) __VA_ARGS__
333#endif 333#endif
334 334
335/* Don't use lchown with glibc older than 2.1.x */
336#if defined(__GLIBC__) && __GLIBC__ <= 2 && __GLIBC_MINOR__ < 1
337# define lchown chown
338#endif
339
340#if defined(__digital__) && defined(__unix__) 335#if defined(__digital__) && defined(__unix__)
341 336
342# include <standards.h> 337# include <standards.h>
@@ -366,16 +361,14 @@ typedef unsigned smalluint;
366#endif 361#endif
367 362
368#include <unistd.h> 363#include <unistd.h>
369#if (defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L) || defined(__GLIBC__) 364#define fdprintf dprintf
370# define fdprintf dprintf
371#endif
372 365
373#if defined(__dietlibc__) 366#if defined(__dietlibc__)
374# undef HAVE_STRCHRNUL 367# undef HAVE_STRCHRNUL
375#endif 368#endif
376 369
377#if defined(__WATCOMC__) 370#if defined(__WATCOMC__)
378# undef HAVE_FDPRINTF 371# undef HAVE_DPRINTF
379# undef HAVE_MEMRCHR 372# undef HAVE_MEMRCHR
380# undef HAVE_MKDTEMP 373# undef HAVE_MKDTEMP
381# undef HAVE_SETBIT 374# undef HAVE_SETBIT
@@ -396,8 +389,8 @@ typedef unsigned smalluint;
396 * These must come after all the HAVE_* macros are defined (or not) 389 * These must come after all the HAVE_* macros are defined (or not)
397 */ 390 */
398 391
399#ifndef HAVE_FDPRINTF 392#ifndef HAVE_DPRINTF
400extern int fdprintf(int fd, const char *format, ...); 393extern int dprintf(int fd, const char *format, ...);
401#endif 394#endif
402 395
403#ifndef HAVE_MEMRCHR 396#ifndef HAVE_MEMRCHR
diff --git a/libbb/platform.c b/libbb/platform.c
index fe7ce1567..04b8961de 100644
--- a/libbb/platform.c
+++ b/libbb/platform.c
@@ -42,9 +42,9 @@ int FAST_FUNC vasprintf(char **string_ptr, const char *format, va_list p)
42} 42}
43#endif 43#endif
44 44
45#ifndef HAVE_FDPRINTF 45#ifndef HAVE_DPRINTF
46/* dprintf is now actually part of POSIX.1, but was only added in 2008 */ 46/* dprintf is now part of POSIX.1, but was only added in 2008 */
47int fdprintf(int fd, const char *format, ...) 47int dprintf(int fd, const char *format, ...)
48{ 48{
49 va_list p; 49 va_list p;
50 int r; 50 int r;