diff options
author | Dave Wysochanski <dwysocha@redhat.com> | 2009-07-16 03:07:45 +0000 |
---|---|---|
committer | Dave Wysochanski <dwysocha@redhat.com> | 2009-07-16 03:07:45 +0000 |
commit | a0b1b1872ebcb8f91348032b4946bfb82e87e344 (patch) | |
tree | a811ea59c765aa91cc70637c9f12c53463b6927c /liblvm | |
parent | 9fac443591ed612a20d1d39719b3ad708369cce5 (diff) | |
download | lvm2-a0b1b1872ebcb8f91348032b4946bfb82e87e344.tar.gz lvm2-a0b1b1872ebcb8f91348032b4946bfb82e87e344.tar.xz lvm2-a0b1b1872ebcb8f91348032b4946bfb82e87e344.zip |
Change default errno value to 0 (no error) and add prototypes in lvm.h
Since we are using errno values, we should use '0' as a default value
which indicates a non-error, rather than defining some made-up default
value that is not defined in errno. If we need to deviate from errno
values, this will most likely indicate a flaw in our design.
Add prototypes for lvm_errno and lvm_errmsg inside lvm.h and provide
a basic description of their function. This fixes a couple compile
warnings.
Author: Dave Wysochanski <dwysocha@redhat.com>
Diffstat (limited to 'liblvm')
-rw-r--r-- | liblvm/lvm.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/liblvm/lvm.h b/liblvm/lvm.h index 19ab5dd7..e179d872 100644 --- a/liblvm/lvm.h +++ b/liblvm/lvm.h @@ -72,6 +72,30 @@ void lvm_destroy(lvm_t libh); int lvm_reload_config(lvm_t libh); /** + * Return stored error no describing last LVM API error. + * + * Users of liblvm should use lvm_errno to determine success or failure + * of the last call, unless the API indicates another method of determining + * success or failure. + * + * \param libh + * Handle obtained from lvm_create. + * + * \return An errno value describing the last LVM error. + */ +int lvm_errno(lvm_t libh); + +/** + * Return stored error message describing last LVM error. + * + * \param libh + * Handle obtained from lvm_create. + * + * \return An error string describing the last LVM error. + */ +const char *lvm_errmsg(lvm_t libh); + +/** * Create a VG with default parameters. * * This API requires calling lvm_vg_write to commit the change to disk. |