summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/svc.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-12-04 04:50:16 +0100
committerLioncash <mathew1800@gmail.com>2018-12-04 08:20:47 +0100
commit5eb057f422ac316cd1b943f6cd00aabc673dc238 (patch)
tree837d0d14341f50cda47b73d5128104980eb1afbc /src/core/hle/kernel/svc.cpp
parentMerge pull request #1852 from VPeruS/fix-format-string (diff)
downloadyuzu-5eb057f422ac316cd1b943f6cd00aabc673dc238.tar
yuzu-5eb057f422ac316cd1b943f6cd00aabc673dc238.tar.gz
yuzu-5eb057f422ac316cd1b943f6cd00aabc673dc238.tar.bz2
yuzu-5eb057f422ac316cd1b943f6cd00aabc673dc238.tar.lz
yuzu-5eb057f422ac316cd1b943f6cd00aabc673dc238.tar.xz
yuzu-5eb057f422ac316cd1b943f6cd00aabc673dc238.tar.zst
yuzu-5eb057f422ac316cd1b943f6cd00aabc673dc238.zip
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
-rw-r--r--src/core/hle/kernel/svc.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 948989b31..d2d893992 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -1575,14 +1575,21 @@ static ResultCode ClearEvent(Handle handle) {
LOG_TRACE(Kernel_SVC, "called, event=0x{:08X}", handle);
const auto& handle_table = Core::CurrentProcess()->GetHandleTable();
- SharedPtr<ReadableEvent> evt = handle_table.Get<ReadableEvent>(handle);
- if (evt == nullptr) {
- LOG_ERROR(Kernel_SVC, "Event handle does not exist, handle=0x{:08X}", handle);
- return ERR_INVALID_HANDLE;
+
+ auto writable_event = handle_table.Get<WritableEvent>(handle);
+ if (writable_event) {
+ writable_event->Clear();
+ return RESULT_SUCCESS;
}
- evt->Clear();
- return RESULT_SUCCESS;
+ auto readable_event = handle_table.Get<ReadableEvent>(handle);
+ if (readable_event) {
+ readable_event->Clear();
+ return RESULT_SUCCESS;
+ }
+
+ LOG_ERROR(Kernel_SVC, "Event handle does not exist, handle=0x{:08X}", handle);
+ return ERR_INVALID_HANDLE;
}
static ResultCode GetProcessInfo(u64* out, Handle process_handle, u32 type) {