Message ID | 20161018080119.GA19984@kos.to |
---|---|
State | New |
Headers | show |
diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 2072b1f..dfc483c 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -9377,16 +9377,17 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, case TARGET_SYSLOG_ACTION_READ_CLEAR: /* Read/clear msgs */ case TARGET_SYSLOG_ACTION_READ_ALL: /* Read last messages */ { + ret = -TARGET_EINVAL; if (len < 0) { - ret = -TARGET_EINVAL; goto fail; } + ret = 0; if (len == 0) { break; } p = lock_user(VERIFY_WRITE, arg2, arg3, 0); if (!p) { - ret = -TARGET_EINVAL; + ret = -TARGET_EFAULT; goto fail; } ret = get_errno(sys_syslog((int)arg1, p, (int)arg3));