From b106d1c501e208b37e077cc14f6d1d35d4b6c669 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Thu, 14 Feb 2019 04:24:30 -0500 Subject: [PATCH] Fix stupid mistake --- native/jni/magiskhide/proc_monitor.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/native/jni/magiskhide/proc_monitor.cpp b/native/jni/magiskhide/proc_monitor.cpp index f87c619a8..7a738c146 100644 --- a/native/jni/magiskhide/proc_monitor.cpp +++ b/native/jni/magiskhide/proc_monitor.cpp @@ -258,12 +258,10 @@ void update_inotify_mask() { // Add /data/app itself to the watch list to detect app (un)installations/updates xinotify_add_watch(new_inotify, DATA_APP, IN_CLOSE_WRITE | IN_MOVED_TO | IN_DELETE); - if (inotify_fd >= 0) { - // Swap and close old fd - int tmp = inotify_fd; - inotify_fd = new_inotify; + int tmp = inotify_fd; + inotify_fd = new_inotify; + if (tmp >= 0) close(tmp); - } } void proc_monitor() {