mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2026-04-18 18:18:44 +00:00
fix(zephyr): explicit cases handling with single return point
This commit is contained in:
parent
1e98749414
commit
eefabe2f62
|
|
@ -28,14 +28,28 @@ __wasi_errno_t
|
||||||
os_nanosleep(const os_timespec *req, os_timespec *rem)
|
os_nanosleep(const os_timespec *req, os_timespec *rem)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
__wasi_errno_t wasi_ret = __WASI_ESUCCESS;
|
||||||
|
|
||||||
ret = nanosleep(req, rem);
|
ret = nanosleep(req, rem);
|
||||||
|
|
||||||
switch(ret)
|
switch(ret)
|
||||||
{
|
{
|
||||||
case 14 /* EFAULT */: return __WASI_EFAULT;
|
case 14 /* EFAULT */:
|
||||||
case 4 /* EINTR */: return __WASI_EFAULT;
|
{
|
||||||
case 22 /* EINVAL */: return __WASI_EINVAL;
|
wasi_ret = __WASI_EFAULT;
|
||||||
case 0: return __WASI_ESUCCESS;
|
break;
|
||||||
}
|
}
|
||||||
|
case 4 /* EINTR */:
|
||||||
|
{
|
||||||
|
wasi_ret = __WASI_EFAULT;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 22 /* EINVAL */:
|
||||||
|
{
|
||||||
|
wasi_ret = __WASI_EINVAL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return wasi_ret;
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user