From 3d7cf1b8c43f9c45e08c27966c2e886892914e92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=B0=9A?= Date: Thu, 10 Oct 2024 13:46:22 +0000 Subject: [PATCH] update services/storage_daemon/mtpfs/src/mtpfs_main.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李尚 --- services/storage_daemon/mtpfs/src/mtpfs_main.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/services/storage_daemon/mtpfs/src/mtpfs_main.cpp b/services/storage_daemon/mtpfs/src/mtpfs_main.cpp index f0a32fd5..62dfb80e 100644 --- a/services/storage_daemon/mtpfs/src/mtpfs_main.cpp +++ b/services/storage_daemon/mtpfs/src/mtpfs_main.cpp @@ -13,6 +13,7 @@ * limitations under the License. */ +#include #include "mtpfs_fuse.h" #include "mtpfs_util.h" #include "storage_service_log.h" @@ -20,10 +21,18 @@ int main(int argc, char **argv) { if (!DelayedSingleton::GetInstance()->ParseOptions(argc, argv)) { + LOGE("mtpfs wrong usage, see %{public}s -h for details.", SmtpfsBaseName(argv[0]).c_str()); + std::cout << "mtpfs wrong usage, see " << SmtpfsBaseName(argv[0]) << " -h for details.\n"; LOGE("mtp wrong usage! See ` %{public}s -h' for details", SmtpfsBaseName(argv[0]).c_str()); return 1; } - bool success = DelayedSingleton::GetInstance()->Exec(); - return !success; + if (!success) { + LOGE("Exec mtpfs.bin to mount mtp device failed."); + std::cout << "Exec mtpfs to mount mtp device failed.\n"; + return 1; + } + + LOGI("Exec mtpfs.bin to mount mtp device success."); + return 0; }