Reverted the kludge introduced to wrap the build platform fstat() and

switch to Axel's hack to just redefine the critical functions via macro
definition in the Jamfile.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11589 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2005-03-05 21:01:56 +00:00
parent 0bd9d4d1c0
commit 6bc2ff3471
2 changed files with 11 additions and 13 deletions

View File

@ -50,10 +50,15 @@ SetupIncludes ;
malloc_debug_flags = -fcheck-memory-usage ;
}
# We need to use a wrapper for fstat() on non-BeOS systems.
local buildPlatformFstatDefines ;
# We need to use a wrapper for some POSIX calls on non-BeOS systems.
local buildPlatformDefines ;
if $(OS) != BEOS {
buildPlatformFstatDefines = build_platform_fstat=fs_shell_fstat ;
buildPlatformDefines =
open=build_platform_open
close=build_platform_close
fstat=build_platform_fstat
read_pos=build_platform_read_pos
;
}
local defines = [ FDefines USER
@ -62,7 +67,7 @@ SetupIncludes ;
UNSAFE_GET_VNODE
#BFS_BIG_ENDIAN_ONLY
$(malloc_debug_defines)
$(buildPlatformFstatDefines)
$(buildPlatformDefines)
] ;
SubDirCcFlags $(defines) $(malloc_debug_flags) ;
SubDirC++Flags $(defines) -fno-exceptions -fno-rtti $(malloc_debug_flags)

View File

@ -21,13 +21,6 @@
#include <string.h>
#include <ctype.h>
// fs_shell support for build platforms whose struct stat is not compatible with ours
#ifdef build_platform_fstat
extern "C" int build_platform_fstat(int fd, struct stat *st);
#else
# define build_platform_fstat fstat
#endif
static const int32 kDesiredAllocationGroups = 56;
// This is the number of allocation groups that will be tried
@ -129,7 +122,7 @@ DeviceOpener::GetSize(off_t *_size, uint32 *_blockSize)
if (ioctl(fDevice, B_GET_GEOMETRY, &geometry) < 0) {
// maybe it's just a file
struct stat stat;
if (build_platform_fstat(fDevice, &stat) < 0)
if (fstat(fDevice, &stat) < 0)
return B_ERROR;
if (_size)
@ -295,7 +288,7 @@ Volume::Mount(const char *deviceName, uint32 flags)
// check if it's a regular file, and if so, disable the cache for the
// underlaying file system
struct stat stat;
if (build_platform_fstat(fDevice, &stat) < 0)
if (fstat(fDevice, &stat) < 0)
RETURN_ERROR(B_ERROR);
#ifndef NO_FILE_UNCACHED_IO