Preserve errno from fsmgr_do_mount

Bug: 17358530
Change-Id: I4cd7403c0b7c4f878d6afa5199f998e6f614adb9
This commit is contained in:
Paul Lawrence 2014-09-09 10:44:51 -07:00
parent c3e6eb21b5
commit cf234dc7e0
2 changed files with 9 additions and 2 deletions

View file

@ -433,7 +433,7 @@ int fs_mgr_do_mount(struct fstab *fstab, char *n_name, char *n_blk_device,
char *tmp_mount_point)
{
int i = 0;
int ret = -1;
int ret = FS_MGR_DOMNT_FAILED;
int mount_errors = 0;
int first_mount_errno = 0;
char *m;
@ -493,7 +493,11 @@ int fs_mgr_do_mount(struct fstab *fstab, char *n_name, char *n_blk_device,
if (mount_errors) {
ERROR("Cannot mount filesystem on %s at %s. error: %s\n",
n_blk_device, m, strerror(first_mount_errno));
ret = -1;
if (first_mount_errno == EBUSY) {
ret = FS_MGR_DOMNT_BUSY;
} else {
ret = FS_MGR_DOMNT_FAILED;
}
} else {
/* We didn't find a match, say so and return an error */
ERROR("Cannot find mount point %s in fstab\n", fstab->recs[i].mount_point);

View file

@ -59,6 +59,9 @@ void fs_mgr_free_fstab(struct fstab *fstab);
#define FS_MGR_MNTALL_DEV_MIGHT_BE_ENCRYPTED 1
#define FS_MGR_MNTALL_DEV_NOT_ENCRYPTED 0
int fs_mgr_mount_all(struct fstab *fstab);
#define FS_MGR_DOMNT_FAILED -1
#define FS_MGR_DOMNT_BUSY -2
int fs_mgr_do_mount(struct fstab *fstab, char *n_name, char *n_blk_device,
char *tmp_mount_point);
int fs_mgr_do_tmpfs_mount(char *n_name);