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:
@@ -3,7 +3,7 @@
|
|||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <BeOSBuildCompatibility.h>
|
#include "compatibility.h"
|
||||||
|
|
||||||
#include <OS.h>
|
#include <OS.h>
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <BeOSBuildCompatibility.h>
|
#include "compatibility.h"
|
||||||
|
|
||||||
#include "command_cp.h"
|
#include "command_cp.h"
|
||||||
|
|
||||||
@@ -160,7 +160,7 @@ public:
|
|||||||
if (!fAttrDir)
|
if (!fAttrDir)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
errno = 0;
|
fssh_set_errno(FSSH_B_OK);
|
||||||
struct dirent *entry = fs_read_attr_dir(fAttrDir);
|
struct dirent *entry = fs_read_attr_dir(fAttrDir);
|
||||||
if (!entry)
|
if (!entry)
|
||||||
return fssh_get_errno();
|
return fssh_get_errno();
|
||||||
@@ -242,7 +242,7 @@ public:
|
|||||||
|
|
||||||
virtual fssh_ssize_t GetNextEntry(struct fssh_dirent *entry, int size)
|
virtual fssh_ssize_t GetNextEntry(struct fssh_dirent *entry, int size)
|
||||||
{
|
{
|
||||||
errno = 0;
|
fssh_set_errno(FSSH_B_OK);
|
||||||
struct dirent *hostEntry = readdir(fDir);
|
struct dirent *hostEntry = readdir(fDir);
|
||||||
if (!hostEntry)
|
if (!hostEntry)
|
||||||
return fssh_get_errno();
|
return fssh_get_errno();
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2007, Ingo Weinhold, [email protected].
|
||||||
|
* 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
|
||||||
|
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <BeOSBuildCompatibility.h>
|
#include "compatibility.h"
|
||||||
|
|
||||||
#include "fssh_errno.h"
|
#include "fssh_errno.h"
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,7 @@
|
|||||||
#ifndef _FSSH_FSSH_H
|
#ifndef _FSSH_FSSH_H
|
||||||
#define _FSSH_FSSH_H
|
#define _FSSH_FSSH_H
|
||||||
|
|
||||||
|
#include "compatibility.h"
|
||||||
#include <BeOSBuildCompatibility.h>
|
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <BeOSBuildCompatibility.h>
|
#include "compatibility.h"
|
||||||
|
|
||||||
#include <OS.h>
|
#include <OS.h>
|
||||||
|
|
||||||
@@ -78,7 +78,9 @@ fssh_get_sem_count(fssh_sem_id id, int32_t *threadCount)
|
|||||||
fssh_status_t
|
fssh_status_t
|
||||||
fssh_set_sem_owner(fssh_sem_id id, fssh_team_id team)
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <BeOSBuildCompatibility.h>
|
#include "compatibility.h"
|
||||||
|
|
||||||
#include "fssh_stat.h"
|
#include "fssh_stat.h"
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <BeOSBuildCompatibility.h>
|
#include "compatibility.h"
|
||||||
|
|
||||||
#include "stat_util.h"
|
#include "stat_util.h"
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <BeOSBuildCompatibility.h>
|
#include "compatibility.h"
|
||||||
|
|
||||||
#include "fssh_string.h"
|
#include "fssh_string.h"
|
||||||
|
|
||||||
@@ -31,11 +31,13 @@ fssh_memcpy(void *dest, const void *source, fssh_size_t length)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
void*
|
void*
|
||||||
fssh_memccpy(void *dest, const void *source, int stopByte, fssh_size_t length)
|
fssh_memccpy(void *dest, const void *source, int stopByte, fssh_size_t length)
|
||||||
{
|
{
|
||||||
return memccpy(dest, source, stopByte, length);
|
return memccpy(dest, source, stopByte, length);
|
||||||
}
|
}
|
||||||
|
#endif // 0
|
||||||
|
|
||||||
|
|
||||||
void*
|
void*
|
||||||
@@ -209,11 +211,13 @@ fssh_strncasecmp(const char *string1, const char *string2, fssh_size_t length)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
char*
|
char*
|
||||||
fssh_strcasestr(const char *string, const char *searchString)
|
fssh_strcasestr(const char *string, const char *searchString)
|
||||||
{
|
{
|
||||||
return strcasestr(string, searchString);
|
return strcasestr(string, searchString);
|
||||||
}
|
}
|
||||||
|
#endif // 0
|
||||||
|
|
||||||
|
|
||||||
char*
|
char*
|
||||||
@@ -269,15 +273,19 @@ fssh_ffs(int i)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
char*
|
char*
|
||||||
fssh_index(const char *s, int c)
|
fssh_index(const char *s, int c)
|
||||||
{
|
{
|
||||||
return index(s, c);
|
return index(s, c);
|
||||||
}
|
}
|
||||||
|
#endif // 0
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
char*
|
char*
|
||||||
fssh_rindex(char const *s, int c)
|
fssh_rindex(char const *s, int c)
|
||||||
{
|
{
|
||||||
return rindex(s, c);
|
return rindex(s, c);
|
||||||
}
|
}
|
||||||
|
#endif // 0
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <BeOSBuildCompatibility.h>
|
#include "compatibility.h"
|
||||||
|
|
||||||
#include "fssh_os.h"
|
#include "fssh_os.h"
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <BeOSBuildCompatibility.h>
|
#include "compatibility.h"
|
||||||
|
|
||||||
#include "fssh_os.h"
|
#include "fssh_os.h"
|
||||||
#include "fssh_time.h"
|
#include "fssh_time.h"
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <BeOSBuildCompatibility.h>
|
#include "compatibility.h"
|
||||||
|
|
||||||
#include "fssh_uio.h"
|
#include "fssh_uio.h"
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <BeOSBuildCompatibility.h>
|
#include "compatibility.h"
|
||||||
|
|
||||||
#include "fssh_unistd.h"
|
#include "fssh_unistd.h"
|
||||||
|
|
||||||
@@ -88,17 +88,18 @@ fssh_ioctl(int fd, unsigned long op, ...)
|
|||||||
= va_arg(list, fssh_device_geometry*);
|
= va_arg(list, fssh_device_geometry*);
|
||||||
|
|
||||||
#ifdef __BEOS__
|
#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
|
geometry->bytes_per_sector
|
||||||
= systemGeometry->bytes_per_sector;
|
= systemGeometry.bytes_per_sector;
|
||||||
geometry->sectors_per_track
|
geometry->sectors_per_track
|
||||||
= systemGeometry->sectors_per_track;
|
= systemGeometry.sectors_per_track;
|
||||||
geometry->cylinder_count = systemGeometry->cylinder_count;
|
geometry->cylinder_count = systemGeometry.cylinder_count;
|
||||||
geometry->head_count = systemGeometry->head_count;
|
geometry->head_count = systemGeometry.head_count;
|
||||||
geometry->device_type = systemGeometry->device_type;
|
geometry->device_type = systemGeometry.device_type;
|
||||||
geometry->removable = systemGeometry->removable;
|
geometry->removable = systemGeometry.removable;
|
||||||
geometry->read_only = systemGeometry->read_only;
|
geometry->read_only = systemGeometry.read_only;
|
||||||
geometry->write_once = systemGeometry->write_once;
|
geometry->write_once = systemGeometry.write_once;
|
||||||
error = B_OK;
|
error = B_OK;
|
||||||
} else
|
} else
|
||||||
error = errno;
|
error = errno;
|
||||||
|
|||||||
Reference in New Issue
Block a user