summaryrefslogtreecommitdiffstats
path: root/mtp/mtp_MtpServer.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2014-09-03 21:04:43 +0200
committerEthan Yonker <dees_troy@teamw.in>2014-09-03 21:04:43 +0200
commit20fd25c231305b0cbc06b5113430aadc003a5c14 (patch)
tree8d0c38974b793a381a639fa0a43965fac21cfad2 /mtp/mtp_MtpServer.cpp
parentEnsure that MTP is enabled by default (diff)
downloadandroid_bootable_recovery-20fd25c231305b0cbc06b5113430aadc003a5c14.tar
android_bootable_recovery-20fd25c231305b0cbc06b5113430aadc003a5c14.tar.gz
android_bootable_recovery-20fd25c231305b0cbc06b5113430aadc003a5c14.tar.bz2
android_bootable_recovery-20fd25c231305b0cbc06b5113430aadc003a5c14.tar.lz
android_bootable_recovery-20fd25c231305b0cbc06b5113430aadc003a5c14.tar.xz
android_bootable_recovery-20fd25c231305b0cbc06b5113430aadc003a5c14.tar.zst
android_bootable_recovery-20fd25c231305b0cbc06b5113430aadc003a5c14.zip
Diffstat (limited to 'mtp/mtp_MtpServer.cpp')
-rwxr-xr-xmtp/mtp_MtpServer.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/mtp/mtp_MtpServer.cpp b/mtp/mtp_MtpServer.cpp
index 8565d5401..af80f6826 100755
--- a/mtp/mtp_MtpServer.cpp
+++ b/mtp/mtp_MtpServer.cpp
@@ -35,16 +35,17 @@
void twmtp_MtpServer::start()
{
- setup();
- add_storage();
- server->run();
+ if (setup() == 0) {
+ add_storage();
+ server->run();
+ }
}
void twmtp_MtpServer::set_storages(storages* mtpstorages) {
stores = mtpstorages;
}
-void twmtp_MtpServer::setup()
+int twmtp_MtpServer::setup()
{
#define USB_MTP_DEVICE "/dev/mtp_usb"
usePtp = false;
@@ -60,8 +61,10 @@ void twmtp_MtpServer::setup()
refserver = server;
MTPI("created new mtpserver object\n");
} else {
- MTPE("could not open MTP driver, errno: %d", errno);
+ MTPE("could not open MTP driver, errno: %d\n", errno);
+ return -1;
}
+ return 0;
}
void twmtp_MtpServer::run()