update services/storage_daemon/mtpfs/src/mtpfs_main.cpp.

Signed-off-by: 李尚 <lishang21@huawei.com>
This commit is contained in:
李尚 2024-10-10 13:46:22 +00:00 committed by Gitee
parent bce7a58692
commit 3d7cf1b8c4
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -13,6 +13,7 @@
* limitations under the License.
*/
#include <iostream>
#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<MtpFileSystem>::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<MtpFileSystem>::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;
}