修改设备互斥32位与64位交互BUG;设备打开失败返回真实的错误代码
This commit is contained in:
parent
c234e0158b
commit
bd292e11db
|
@ -337,7 +337,7 @@ std::string shared_memory::read(void)
|
|||
|
||||
std::string ret("");
|
||||
size_t len = 0;
|
||||
int off = sizeof(size_t);
|
||||
int off = 4; // sizeof(size_t);
|
||||
|
||||
memcpy(&len, buf, off);
|
||||
ret = std::string(buf + off, len);
|
||||
|
@ -351,7 +351,7 @@ int shared_memory::write(const char* data, size_t len)
|
|||
return SCANNER_ERR_INSUFFICIENT_MEMORY;
|
||||
|
||||
char* buf = get_buf();
|
||||
int off = sizeof(len);
|
||||
int off = 4; // sizeof(len);
|
||||
if (buf == (char*)-1)
|
||||
return errno;
|
||||
|
||||
|
|
|
@ -774,7 +774,7 @@ SANE_Status hg_sane_middleware::open(SANE_String_Const devicename, SANE_Handle*
|
|||
return SANE_STATUS_ACCESS_DENIED;
|
||||
}
|
||||
else
|
||||
return SANE_STATUS_UNSUPPORTED;
|
||||
return (SANE_Status)err; // SANE_STATUS_UNSUPPORTED;
|
||||
}
|
||||
SANE_Option_Descriptor* hg_sane_middleware::from_json(scanner_handle h, json* jsn, int opt_no)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue