Skip to content

Commit

Permalink
[fs-management] Add clarification around umount errors
Browse files Browse the repository at this point in the history
Change-Id: I81502da41ec760a4b34a6b54fce14504632a6dd0
  • Loading branch information
Sean Klein committed Dec 20, 2016
1 parent 44c944b commit 7a5386b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions system/ulib/fs-management/include/fs-management/mount.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,8 @@ mx_status_t mount(const char* devicepath, const char* mountpath, disk_format_t d
mx_status_t (*cb)(int argc, const char** argv, mx_handle_t h));

// Umount the filesystem process.
//
// Returns ERR_BAD_STATE if mountpath could not be opened.
// Returns ERR_NOT_FOUND if there is no mounted filesystem on mountpath.
// Other errors may also be returned if problems occur while unmounting.
mx_status_t umount(const char* mountpath);
2 changes: 1 addition & 1 deletion system/ulib/fs-management/mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ mx_status_t umount(const char* mountpath) {
int fd = open(mountpath, O_DIRECTORY | O_NOREMOTE);
if (fd < 0) {
fprintf(stderr, "Could not open directory: %s\n", strerror(errno));
return -1;
return ERR_BAD_STATE;
}

mx_status_t status = ioctl_devmgr_unmount_node(fd);
Expand Down

0 comments on commit 7a5386b

Please sign in to comment.