]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfsprogs: libxcmd: avoid exiting when an error occurs
authorAlex Elder <aelder@sgi.com>
Mon, 3 Oct 2011 12:49:19 +0000 (12:49 +0000)
committerAlex Elder <aelder@sgi.com>
Thu, 6 Oct 2011 20:19:31 +0000 (15:19 -0500)
commit7e760c1353a1aa5e4172e8ebdf0c8d8bb99c0855
tree5bf3193554c1abc363d68ffd4b6069d886e30db0
parent1f4e1f7f0d66f583f3c7c943628cf8fb857606fc
xfsprogs: libxcmd: avoid exiting when an error occurs

In a number of spots handling setting up fs_table, libxcmd simply
prints a message and exits if an error occurs.  There should be no
real need to exit in these cases.  Notifying the user that something
went wrong is appropriate but this should not preclude continued
operation.  In a few cases the contents of fs_table built up so far
are discarded as well, and this too can be avoided.

Make it so errors do not lead to exits, nor do they result in
destroying fs_table.  Doing this requires returning a value from
fs_extract_mount_options() so its caller can skip other processing
in this case.  But in most cases we simply no longer exit, and no
longer destroy the fs_table.  This means there is no more use for
fs_table_destroy(), so it can be removed.

There is a sort of short-circuit exit in fs_table_insert_project()
that is unnecessary as well, so get rid of it.

Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
libxcmd/paths.c