Commit b826b8ec authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Don't pass silly error numbers to MsgTrans

Detail:
  c/LanMan - Don't pass silly error numbers to MessageTrans_ErrorLookup - the kernel will now fault them.
Admin:
  Tested on Raspberry Pi 3
  Fixes "bad error pointer" message when e.g. failing to log on to a share:
  https://www.riscosopen.org/forum/forums/4/topics/5264


Version 2.55. Tagged as 'LanManFS-2_55'
parent a596ce3c
/* (2.54) /* (2.55)
* *
* This file is automatically maintained by srccommit, do not edit manually. * This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1. * Last processed by srccommit version: 1.1.
* *
*/ */
#define Module_MajorVersion_CMHG 2.54 #define Module_MajorVersion_CMHG 2.55
#define Module_MinorVersion_CMHG #define Module_MinorVersion_CMHG
#define Module_Date_CMHG 03 Apr 2016 #define Module_Date_CMHG 14 Apr 2016
#define Module_MajorVersion "2.54" #define Module_MajorVersion "2.55"
#define Module_Version 254 #define Module_Version 255
#define Module_MinorVersion "" #define Module_MinorVersion ""
#define Module_Date "03 Apr 2016" #define Module_Date "14 Apr 2016"
#define Module_ApplicationDate "03-Apr-16" #define Module_ApplicationDate "14-Apr-16"
#define Module_ComponentName "LanManFS" #define Module_ComponentName "LanManFS"
#define Module_ComponentPath "castle/RiscOS/Sources/Networking/Omni/Protocols/LanManFS" #define Module_ComponentPath "castle/RiscOS/Sources/Networking/Omni/Protocols/LanManFS"
#define Module_FullVersion "2.54" #define Module_FullVersion "2.55"
#define Module_HelpVersion "2.54 (03 Apr 2016)" #define Module_HelpVersion "2.55 (14 Apr 2016)"
#define Module_LibraryVersionInfo "2:54" #define Module_LibraryVersionInfo "2:55"
...@@ -140,8 +140,10 @@ err_t MsgSetOSError (_kernel_oserror *err) ...@@ -140,8 +140,10 @@ err_t MsgSetOSError (_kernel_oserror *err)
_kernel_oserror *MsgError(int which) _kernel_oserror *MsgError(int which)
{ {
char token[12]; struct {
_kernel_oserror *e; int errnum;
char errmess[8];
} token;
if (which == OK) return NULL; /* No error */ if (which == OK) return NULL; /* No error */
...@@ -152,22 +154,17 @@ _kernel_oserror *MsgError(int which) ...@@ -152,22 +154,17 @@ _kernel_oserror *MsgError(int which)
which = EHOWDTHATHAPPEN; which = EHOWDTHATHAPPEN;
} }
sprintf(token, "@@@@E%02u", which); sprintf(token.errmess, "E%02u", which);
e = _swix(MessageTrans_ErrorLookup, _INR(0,3), if ((which == EDIRNOTEMPTY) || (which == ENOACCESS))
token, msg_struct, &msg_buff, sizeof(msg_buff));
if (e->errnum == 0x40404040)
{ {
/* Same error number out as went in, looked up OK */ /* Fudge for Filer_Action which expects a FileCore
if ((which == EDIRNOTEMPTY) || (which == ENOACCESS)) * style specific error return code
{ */
/* Fudge for Filer_Action which expects a FileCore which = ErrorNumber_DirNotEmpty;
* style specific error return code
*/
which = ErrorNumber_DirNotEmpty;
}
msg_buff.errnum = Our_Error_Base + which;
} }
return(e); token.errnum = Our_Error_Base + which;
return _swix(MessageTrans_ErrorLookup, _INR(0,3),
&token, msg_struct, &msg_buff, sizeof(msg_buff));
} }
/* ------------------ */ /* ------------------ */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment