aboutsummaryrefslogtreecommitdiff
path: root/doc/gdbm.texinfo
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2011-11-15 12:39:10 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2011-11-15 12:39:10 +0000
commitaf116bb7d7d5a53310e48d196ebe577b9a63f799 (patch)
tree904c07043b29bc3bcf9c2232276187c9fd1f16b4 /doc/gdbm.texinfo
parent4931e4393ebff15289ad282f3d3dd0fba4999986 (diff)
downloadgdbm-af116bb7d7d5a53310e48d196ebe577b9a63f799.tar.gz
gdbm-af116bb7d7d5a53310e48d196ebe577b9a63f799.tar.bz2
Return a meaningful error code if failed to restore file's metadata.
* src/gdbm.h.in (GDBM_ERR_FILE_OWNER) (GDBM_ERR_FILE_MODE): New error codes. (_GDBM_MAX_ERRNO): Update. * src/gdbmerrno.c (gdbm_errlist): Add new error codes. * src/gdbmload.c (_set_gdbm_meta_info): Set gdbm_errno and return 1 in case of errors. (_gdbm_load_file): Propagate the return value from _set_gdbm_meta_info. * src/gdbm_load.c (main): Handle mild error conditions. * export/export.c (usage): Print the GDBM version the program is linked with. * doc/gdbm.texinfo: Document changes.
Diffstat (limited to 'doc/gdbm.texinfo')
-rw-r--r--doc/gdbm.texinfo49
1 files changed, 43 insertions, 6 deletions
diff --git a/doc/gdbm.texinfo b/doc/gdbm.texinfo
index 4dcdd76..1e51322 100644
--- a/doc/gdbm.texinfo
+++ b/doc/gdbm.texinfo
@@ -727,8 +727,10 @@ set @code{gdbm_errno} to @samp{GDBM_NO_DBNAME} and return
727The @var{flag} has the same meaning as the @var{flag} argument 727The @var{flag} has the same meaning as the @var{flag} argument
728to the @code{gdbm_store} function (@pxref{Store}). 728to the @code{gdbm_store} function (@pxref{Store}).
729 729
730The function returns 0 upon successful completion or -1 on error. In 730The function returns 0 upon successful completion or -1 on fatal
731the latter case, @code{gdbm_errno} will be set to one of the 731errors and 1 on mild (non-fatal) errors.
732
733If a fatal error occurs, @code{gdbm_errno} will be set to one of the
732following values: 734following values:
733 735
734@table @asis 736@table @asis
@@ -753,10 +755,28 @@ length specification. Application developers are advised to treat
753this error equally as @samp{GDBM_ILLEGAL_DATA}. 755this error equally as @samp{GDBM_ILLEGAL_DATA}.
754@end table 756@end table
755 757
756If any error, excepting @var{GDBM_FILE_OPEN_ERROR}, occurs and the 758Mild errors mean that the function was able to successfully load and
757input file is in ASCII format, the number of line in which the error 759restore the data, but was unable to change database file metadata
758occurred will be stored in the location pointed to by the 760afterwards. The table below lists possible values for @code{gdbm_errno}
759@var{errline} parameter, unless it is @samp{NULL}. 761in this case. To get more detail, inspect the system @code{errno} variable.
762
763@table @asis
764@kwindex GDBM_ERR_FILE_OWNER
765@item GDBM_ERR_FILE_OWNER
766The function was unable to restore database file owner.
767
768@kwindex GDBM_ERR_FILE_MODE
769@item GDBM_ERR_FILE_MODE
770The function was unable to restore database file mode (permission bits).
771@end table
772
773If an error occurs while loading data from an input file in ASCII
774format, the number of line in which the error occurred will be stored
775in the location pointed to by the @var{errline} parameter, unless it
776is @samp{NULL}.
777
778If the line information is not available or applicable, @var{errline}
779will be set to @samp{0}.
760@end deftypefn 780@end deftypefn
761 781
762@deftypefn {gdbm interface} int gdbm_dump_to_file (GDBM_FILE @var{dbf}, @ 782@deftypefn {gdbm interface} int gdbm_dump_to_file (GDBM_FILE @var{dbf}, @
@@ -1676,6 +1696,23 @@ Output database name is not specified. This error code is set by
1676@code{gdbm_load} (@pxref{gdbm_load function,,gdbm_load}) if the first 1696@code{gdbm_load} (@pxref{gdbm_load function,,gdbm_load}) if the first
1677argument points to @samp{NULL} and the input file does not specify the 1697argument points to @samp{NULL} and the input file does not specify the
1678database name. 1698database name.
1699
1700@kwindex GDBM_ERR_FILE_OWNER
1701@item GDBM_ERR_FILE_OWNER
1702This error code is set by @code{gdbm_load} if it is unable to restore
1703database file owner. It is a mild error condition, meaning that the
1704data have been restored successfully, only changing the target file
1705owner failed. Inspect the system @code{errno} variable to get a more
1706detailed diagnostics.
1707
1708@kwindex GDBM_ERR_FILE_MODE
1709@item GDBM_ERR_FILE_MODE
1710This error code is set by @code{gdbm_load} if it is unable to restore
1711database file mode. It is a mild error condition, meaning that the data
1712have been restored successfully, only changing the target file owner
1713failed. Inspect the system @code{errno} variable to get a more
1714detailed diagnostics.
1715
1679@end table 1716@end table
1680 1717
1681@node Compatibility 1718@node Compatibility

Return to:

Send suggestions and report system problems to the System administrator.