am cf234dc7: Preserve errno from fsmgr_do_mount

* commit 'cf234dc7e081ac4063c3c5ddcdd4da40c82d51cb':
  Preserve errno from fsmgr_do_mount
This commit is contained in:
Paul Lawrence 2014-09-12 19:58:47 +00:00 committed by Android Git Automerger
commit fdf93c0631
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);