From 69a5bd4357a49b63204e7f56cf34a13fa75a7e88 Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Wed, 28 Jun 2017 13:36:52 -0700 Subject: [PATCH] fs_mgr: report errno string for __mount errors Need to know why the mount failed. clang_format adjustment. Basically change LINFO to PINFO to cause the log message for the mount report to be accompanied by a strerror(errno) message appended to the end so that it is clear why the mount was rejected. Test: manual Bug: 63100799 Change-Id: Ic958299759befe5d5b11bdc95fea5d64cad86412 --- fs_mgr/fs_mgr.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs_mgr/fs_mgr.cpp b/fs_mgr/fs_mgr.cpp index 8c19a812c..ba3075610 100644 --- a/fs_mgr/fs_mgr.cpp +++ b/fs_mgr/fs_mgr.cpp @@ -476,10 +476,11 @@ static int __mount(const char *source, const char *target, const struct fstab_re if ((info.st_mode & S_IFMT) == S_IFLNK) unlink(target); mkdir(target, 0755); + errno = 0; ret = mount(source, target, rec->fs_type, mountflags, rec->fs_options); save_errno = errno; - LINFO << __FUNCTION__ << "(source=" << source << ",target=" - << target << ",type=" << rec->fs_type << ")=" << ret; + PINFO << __FUNCTION__ << "(source=" << source << ",target=" << target + << ",type=" << rec->fs_type << ")=" << ret; if ((ret == 0) && (mountflags & MS_RDONLY) != 0) { fs_mgr_set_blk_ro(source); }