From 3b8715d80426aded583ff893ded7deedcce1ad43 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sat, 28 Apr 2007 23:40:04 +0000 Subject: [PATCH] Provide a way to convert FS shell error codes to host platform error codes. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20890 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/build/os/support/Errors.h | 1 + headers/private/fs_shell/fssh_errno.h | 1 + src/build/libroot/errors.cpp | 6 ++++++ src/tools/fs_shell/errno.cpp | 10 ++++++++++ 4 files changed, 18 insertions(+) diff --git a/headers/build/os/support/Errors.h b/headers/build/os/support/Errors.h index 5184484403..75d630c29b 100644 --- a/headers/build/os/support/Errors.h +++ b/headers/build/os/support/Errors.h @@ -408,6 +408,7 @@ extern "C" { #endif extern int *_haiku_build_errno(); +extern int _haiku_to_host_error(int error); #ifdef __cplusplus } diff --git a/headers/private/fs_shell/fssh_errno.h b/headers/private/fs_shell/fssh_errno.h index 2bfa252304..890da56e2b 100644 --- a/headers/private/fs_shell/fssh_errno.h +++ b/headers/private/fs_shell/fssh_errno.h @@ -17,6 +17,7 @@ extern int *_fssh_errnop(void); extern int fssh_get_errno(void); extern void fssh_set_errno(int error); +extern int fssh_to_host_error(int error); #ifdef __cplusplus } /* "C" */ diff --git a/src/build/libroot/errors.cpp b/src/build/libroot/errors.cpp index 1b6c548937..30871dbbaf 100644 --- a/src/build/libroot/errors.cpp +++ b/src/build/libroot/errors.cpp @@ -180,3 +180,9 @@ _haiku_build_errno() return &localErrno; } +// _haiku_to_host_error +int +_haiku_to_host_error(int error) +{ + return to_host_error(error); +} diff --git a/src/tools/fs_shell/errno.cpp b/src/tools/fs_shell/errno.cpp index 835da29799..36802bfc87 100644 --- a/src/tools/fs_shell/errno.cpp +++ b/src/tools/fs_shell/errno.cpp @@ -29,3 +29,13 @@ fssh_set_errno(int error) { errno = error; } + +int +fssh_to_host_error(int error) +{ + #if __BEOS__ + return error; + #else + return _haiku_to_host_error(error); + #endif +}