BeOS build fixes:

* On BeOS compatible host platforms we must not include
  BeOSBuildCompatibility.h, but HaikuBuildCompatibility.h.
* Fixed errno usage in command_cp.cpp.
* Fixed fssh_ioctl().
* fssh_set_sem_owner() doesn't invoke BeOS's set_sem_owner() anymore or
  otherwise the FS's semaphores are assigned to the kernel.
* Commented out <string.h> functions that don't exist under BeOS (and aren't
  used anyway).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20934 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2007-04-30 17:19:19 +00:00
parent a4d337d5dd
commit c3c6ad0a0b
13 changed files with 52 additions and 25 deletions

View File

@ -3,7 +3,7 @@
* Distributed under the terms of the MIT License.
*/
#include <BeOSBuildCompatibility.h>
#include "compatibility.h"
#include <OS.h>

View File

@ -3,7 +3,7 @@
* Distributed under the terms of the MIT License.
*/
#include <BeOSBuildCompatibility.h>
#include "compatibility.h"
#include "command_cp.h"
@ -160,7 +160,7 @@ public:
if (!fAttrDir)
return 0;
errno = 0;
fssh_set_errno(FSSH_B_OK);
struct dirent *entry = fs_read_attr_dir(fAttrDir);
if (!entry)
return fssh_get_errno();
@ -242,7 +242,7 @@ public:
virtual fssh_ssize_t GetNextEntry(struct fssh_dirent *entry, int size)
{
errno = 0;
fssh_set_errno(FSSH_B_OK);
struct dirent *hostEntry = readdir(fDir);
if (!hostEntry)
return fssh_get_errno();

View File

@ -0,0 +1,17 @@
/*
* Copyright 2007, Ingo Weinhold, bonefish@cs.tu-berlin.de.
* Distributed under the terms of the MIT License.
*/
#ifndef _FSSH_COMPATIBILITY_H
#define _FSSH_COMPATIBILITY_H
#ifdef __BEOS__
# ifndef HAIKU_HOST_PLATFORM_HAIKU
# include <HaikuBuildCompatibility.h>
# endif
#else
# include <BeOSBuildCompatibility.h>
#endif
#endif // _FSSH_COMPATIBILITY_H

View File

@ -3,7 +3,7 @@
* Distributed under the terms of the MIT License.
*/
#include <BeOSBuildCompatibility.h>
#include "compatibility.h"
#include "fssh_errno.h"

View File

@ -6,8 +6,7 @@
#ifndef _FSSH_FSSH_H
#define _FSSH_FSSH_H
#include <BeOSBuildCompatibility.h>
#include "compatibility.h"
#include <map>
#include <string>

View File

@ -3,7 +3,7 @@
* Distributed under the terms of the MIT License.
*/
#include <BeOSBuildCompatibility.h>
#include "compatibility.h"
#include <OS.h>
@ -78,7 +78,9 @@ fssh_get_sem_count(fssh_sem_id id, int32_t *threadCount)
fssh_status_t
fssh_set_sem_owner(fssh_sem_id id, fssh_team_id team)
{
return set_sem_owner(id, team);
// return set_sem_owner(id, team);
// The FS shell is the kernel and no other teams exist.
return FSSH_B_OK;
}

View File

@ -3,7 +3,7 @@
* Distributed under the terms of the MIT License.
*/
#include <BeOSBuildCompatibility.h>
#include "compatibility.h"
#include "fssh_stat.h"

View File

@ -3,7 +3,7 @@
* Distributed under the terms of the MIT License.
*/
#include <BeOSBuildCompatibility.h>
#include "compatibility.h"
#include "stat_util.h"

View File

@ -3,7 +3,7 @@
* Distributed under the terms of the MIT License.
*/
#include <BeOSBuildCompatibility.h>
#include "compatibility.h"
#include "fssh_string.h"
@ -31,11 +31,13 @@ fssh_memcpy(void *dest, const void *source, fssh_size_t length)
}
#if 0
void*
fssh_memccpy(void *dest, const void *source, int stopByte, fssh_size_t length)
{
return memccpy(dest, source, stopByte, length);
}
#endif // 0
void*
@ -209,11 +211,13 @@ fssh_strncasecmp(const char *string1, const char *string2, fssh_size_t length)
}
#if 0
char*
fssh_strcasestr(const char *string, const char *searchString)
{
return strcasestr(string, searchString);
}
#endif // 0
char*
@ -269,15 +273,19 @@ fssh_ffs(int i)
}
#if 0
char*
fssh_index(const char *s, int c)
{
return index(s, c);
}
#endif // 0
#if 0
char*
fssh_rindex(char const *s, int c)
{
return rindex(s, c);
}
#endif // 0

View File

@ -3,7 +3,7 @@
* Distributed under the terms of the MIT License.
*/
#include <BeOSBuildCompatibility.h>
#include "compatibility.h"
#include "fssh_os.h"

View File

@ -3,7 +3,7 @@
* Distributed under the terms of the MIT License.
*/
#include <BeOSBuildCompatibility.h>
#include "compatibility.h"
#include "fssh_os.h"
#include "fssh_time.h"

View File

@ -3,7 +3,7 @@
* Distributed under the terms of the MIT License.
*/
#include <BeOSBuildCompatibility.h>
#include "compatibility.h"
#include "fssh_uio.h"

View File

@ -3,7 +3,7 @@
* Distributed under the terms of the MIT License.
*/
#include <BeOSBuildCompatibility.h>
#include "compatibility.h"
#include "fssh_unistd.h"
@ -88,17 +88,18 @@ fssh_ioctl(int fd, unsigned long op, ...)
= va_arg(list, fssh_device_geometry*);
#ifdef __BEOS__
if (ioctl(fd, B_GET_GEOMETRY, systemGeometry) == 0) {
device_geometry systemGeometry;
if (ioctl(fd, B_GET_GEOMETRY, &systemGeometry) == 0) {
geometry->bytes_per_sector
= systemGeometry->bytes_per_sector;
= systemGeometry.bytes_per_sector;
geometry->sectors_per_track
= systemGeometry->sectors_per_track;
geometry->cylinder_count = systemGeometry->cylinder_count;
geometry->head_count = systemGeometry->head_count;
geometry->device_type = systemGeometry->device_type;
geometry->removable = systemGeometry->removable;
geometry->read_only = systemGeometry->read_only;
geometry->write_once = systemGeometry->write_once;
= systemGeometry.sectors_per_track;
geometry->cylinder_count = systemGeometry.cylinder_count;
geometry->head_count = systemGeometry.head_count;
geometry->device_type = systemGeometry.device_type;
geometry->removable = systemGeometry.removable;
geometry->read_only = systemGeometry.read_only;
geometry->write_once = systemGeometry.write_once;
error = B_OK;
} else
error = errno;