summaryrefslogtreecommitdiffstats
path: root/partitionmanager.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2014-09-11 16:28:20 +0200
committerEthan Yonker <dees_troy@teamw.in>2014-09-11 16:28:20 +0200
commit8613dc027826b0e6e7a368a600ecf3c9899704d3 (patch)
tree1e866dfd28043029b983d7d97f64a683b52f00ae /partitionmanager.cpp
parentMTP: Build flag for setting custom MTP device/path (diff)
downloadandroid_bootable_recovery-8613dc027826b0e6e7a368a600ecf3c9899704d3.tar
android_bootable_recovery-8613dc027826b0e6e7a368a600ecf3c9899704d3.tar.gz
android_bootable_recovery-8613dc027826b0e6e7a368a600ecf3c9899704d3.tar.bz2
android_bootable_recovery-8613dc027826b0e6e7a368a600ecf3c9899704d3.tar.lz
android_bootable_recovery-8613dc027826b0e6e7a368a600ecf3c9899704d3.tar.xz
android_bootable_recovery-8613dc027826b0e6e7a368a600ecf3c9899704d3.tar.zst
android_bootable_recovery-8613dc027826b0e6e7a368a600ecf3c9899704d3.zip
Diffstat (limited to '')
-rw-r--r--partitionmanager.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index bc27ccbcb..d83518b05 100644
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -29,6 +29,7 @@
#include <fcntl.h>
#include <iostream>
#include <iomanip>
+#include <sys/wait.h>
#include "variables.h"
#include "twcommon.h"
#include "partitions.hpp"
@@ -2212,8 +2213,12 @@ bool TWPartitionManager::Disable_MTP(void) {
TWFunc::write_file("/sys/class/android_usb/android0/idVendor", vendorstr);
TWFunc::write_file("/sys/class/android_usb/android0/idProduct", productstr);
if (mtppid) {
- kill(mtppid, SIGTERM);
+ LOGINFO("Disabling MTP\n");
+ int status;
+ kill(mtppid, SIGKILL);
mtppid = 0;
+ // We don't care about the exit value, but this prevents a zombie process
+ waitpid(mtppid, &status, 0);
}
property_set("sys.usb.config", "adb");
DataManager::SetValue("tw_mtp_enabled", 0);