diff options
Diffstat (limited to 'gnu/usr.sbin/sendmail/libsmdb')
-rw-r--r-- | gnu/usr.sbin/sendmail/libsmdb/smdb.c | 28 | ||||
-rw-r--r-- | gnu/usr.sbin/sendmail/libsmdb/smdb1.c | 14 | ||||
-rw-r--r-- | gnu/usr.sbin/sendmail/libsmdb/smdb2.c | 16 | ||||
-rw-r--r-- | gnu/usr.sbin/sendmail/libsmdb/smndbm.c | 6 |
4 files changed, 34 insertions, 30 deletions
diff --git a/gnu/usr.sbin/sendmail/libsmdb/smdb.c b/gnu/usr.sbin/sendmail/libsmdb/smdb.c index da694d07fe1..740f967b9c8 100644 --- a/gnu/usr.sbin/sendmail/libsmdb/smdb.c +++ b/gnu/usr.sbin/sendmail/libsmdb/smdb.c @@ -8,7 +8,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Sendmail: smdb.c,v 8.49 2001/09/04 22:43:45 ca Exp $") +SM_RCSID("@(#)$Sendmail: smdb.c,v 8.52 2001/09/11 04:04:52 gshapiro Exp $") #include <fcntl.h> #include <stdlib.h> @@ -18,7 +18,7 @@ SM_RCSID("@(#)$Sendmail: smdb.c,v 8.49 2001/09/04 22:43:45 ca Exp $") #include <sendmail/sendmail.h> #include <libsmdb/smdb.h> -/* +/* ** SMDB_MALLOC_DATABASE -- Allocates a database structure. ** ** Parameters: @@ -43,7 +43,7 @@ smdb_malloc_database() } -/* +/* ** SMDB_FREE_DATABASE -- Unallocates a database structure. ** ** Parameters: @@ -60,7 +60,7 @@ smdb_free_database(database) if (database != NULL) free(database); } -/* +/* ** SMDB_LOCKFILE -- lock a file using flock or (shudder) fcntl locking ** ** Parameters: @@ -155,7 +155,7 @@ smdb_lockfile(fd, type) errno = save_errno; return false; } -/* +/* ** SMDB_OPEN_DATABASE -- Opens a database. ** ** This opens a database. If type is SMDB_DEFAULT it tries to @@ -246,7 +246,7 @@ smdb_open_database(database, db_name, mode, mode_mask, sff, type, user_info, return SMDBE_UNKNOWN_DB_TYPE; } -/* +/* ** SMDB_ADD_EXTENSION -- Adds an extension to a file name. ** ** Just adds a . followed by a string to a db_name if there @@ -293,7 +293,7 @@ smdb_add_extension(full_name, max_full_name_len, db_name, extension) return SMDBE_OK; } -/* +/* ** SMDB_LOCK_FILE -- Locks the database file. ** ** Locks the actual database file. @@ -331,7 +331,7 @@ smdb_lock_file(lock_fd, db_name, mode, sff, extension) return SMDBE_OK; } -/* +/* ** SMDB_UNLOCK_FILE -- Unlocks a file ** ** Unlocks a file. @@ -355,7 +355,7 @@ smdb_unlock_file(lock_fd) return SMDBE_OK; } -/* +/* ** SMDB_LOCK_MAP -- Locks a database. ** ** Parameters: @@ -382,7 +382,7 @@ smdb_lock_map(database, type) return SMDBE_LOCK_NOT_GRANTED; return SMDBE_OK; } -/* +/* ** SMDB_UNLOCK_MAP -- Unlocks a database ** ** Parameters: @@ -405,7 +405,7 @@ smdb_unlock_map(database) return SMDBE_LOCK_NOT_HELD; return SMDBE_OK; } -/* +/* ** SMDB_SETUP_FILE -- Gets db file ready for use. ** ** Makes sure permissions on file are safe and creates it if it @@ -449,7 +449,7 @@ smdb_setup_file(db_name, extension, mode_mask, sff, user_info, stat_info) return SMDBE_OK; } -/* +/* ** SMDB_FILECHANGED -- Checks to see if a file changed. ** ** Compares the passed in stat_info with a current stat on @@ -481,7 +481,7 @@ smdb_filechanged(db_name, extension, db_fd, stat_info) return result; return filechanged(db_file_name, db_fd, stat_info); } -/* +/* ** SMDB_PRINT_AVAILABLE_TYPES -- Prints the names of the available types. ** ** Parameters: @@ -502,7 +502,7 @@ smdb_print_available_types() printf("btree\n"); #endif /* NEWDB */ } -/* +/* ** SMDB_DB_DEFINITION -- Given a database type, return database definition ** ** Reads though a structure making an association with the database diff --git a/gnu/usr.sbin/sendmail/libsmdb/smdb1.c b/gnu/usr.sbin/sendmail/libsmdb/smdb1.c index 7349c00414f..79ca6bb7532 100644 --- a/gnu/usr.sbin/sendmail/libsmdb/smdb1.c +++ b/gnu/usr.sbin/sendmail/libsmdb/smdb1.c @@ -8,7 +8,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Sendmail: smdb1.c,v 8.51 2001/05/10 01:23:58 ca Exp $") +SM_RCSID("@(#)$Sendmail: smdb1.c,v 8.55 2001/09/12 21:19:12 gshapiro Exp $") #include <unistd.h> #include <stdlib.h> @@ -35,7 +35,7 @@ struct smdb_db1_cursor }; typedef struct smdb_db1_cursor SMDB_DB1_CURSOR; -/* +/* ** SMDB_TYPE_TO_DB1_TYPE -- Translates smdb database type to db1 type. ** ** Parameters: @@ -63,7 +63,7 @@ smdb_type_to_db1_type(type) /* Should never get here thanks to test in smdb_db_open() */ return DB_HASH; } -/* +/* ** SMDB_PUT_FLAGS_TO_DB1_FLAGS -- Translates smdb put flags to db1 put flags. ** ** Parameters: @@ -90,7 +90,7 @@ smdb_put_flags_to_db1_flags(flags) return return_flags; } -/* +/* ** SMDB_CURSOR_GET_FLAGS_TO_SMDB1 ** ** Parameters: @@ -151,16 +151,18 @@ int smdb1_close(database) SMDB_DATABASE *database; { + int result; SMDB_DB1_DATABASE *db1 = (SMDB_DB1_DATABASE *) database->smdb_impl; DB *db = ((SMDB_DB1_DATABASE *) database->smdb_impl)->smdb1_db; + result = db->close(db); if (db1->smdb1_lock_fd != -1) (void) close(db1->smdb1_lock_fd); free(db1); database->smdb_impl = NULL; - return db->close(db); + return result; } int @@ -395,7 +397,7 @@ smdb1_cursor(database, cursor, flags) return SMDBE_OK; } -/* +/* ** SMDB_DB_OPEN -- Opens a db1 database. ** ** Parameters: diff --git a/gnu/usr.sbin/sendmail/libsmdb/smdb2.c b/gnu/usr.sbin/sendmail/libsmdb/smdb2.c index f4c3b17db1f..57f58d1fe61 100644 --- a/gnu/usr.sbin/sendmail/libsmdb/smdb2.c +++ b/gnu/usr.sbin/sendmail/libsmdb/smdb2.c @@ -8,7 +8,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Sendmail: smdb2.c,v 8.65 2001/05/10 01:23:58 ca Exp $") +SM_RCSID("@(#)$Sendmail: smdb2.c,v 8.69 2001/09/12 21:19:12 gshapiro Exp $") #include <fcntl.h> #include <stdlib.h> @@ -29,7 +29,7 @@ struct smdb_db2_database }; typedef struct smdb_db2_database SMDB_DB2_DATABASE; -/* +/* ** SMDB_TYPE_TO_DB2_TYPE -- Translates smdb database type to db2 type. ** ** Parameters: @@ -56,7 +56,7 @@ smdb_type_to_db2_type(type) return DB_UNKNOWN; } -/* +/* ** DB2_ERROR_TO_SMDB -- Translates db2 errors to smdbe errors ** ** Parameters: @@ -139,7 +139,7 @@ db2_error_to_smdb(error) } return result; } -/* +/* ** SMDB_PUT_FLAGS_TO_DB2_FLAGS -- Translates smdb put flags to db2 put flags. ** ** Parameters: @@ -166,7 +166,7 @@ smdb_put_flags_to_db2_flags(flags) return return_flags; } -/* +/* ** SMDB_CURSOR_GET_FLAGS_TO_DB2 -- Translates smdb cursor get flags to db2 ** getflags. ** @@ -225,16 +225,18 @@ int smdb2_close(database) SMDB_DATABASE *database; { + int result; SMDB_DB2_DATABASE *db2 = (SMDB_DB2_DATABASE *) database->smdb_impl; DB *db = ((SMDB_DB2_DATABASE *) database->smdb_impl)->smdb2_db; + result = db2_error_to_smdb(db->close(db, 0)); if (db2->smdb2_lock_fd != -1) close(db2->smdb2_lock_fd); free(db2); database->smdb_impl = NULL; - return db2_error_to_smdb(db->close(db, 0)); + return result; } int @@ -530,7 +532,7 @@ smdb_db_open_internal(db_name, db_type, db_flags, db_params, db) return db2_error_to_smdb(result); } # endif /* DB_VERSION_MAJOR > 2 */ -/* +/* ** SMDB_DB_OPEN -- Opens a db database. ** ** Parameters: diff --git a/gnu/usr.sbin/sendmail/libsmdb/smndbm.c b/gnu/usr.sbin/sendmail/libsmdb/smndbm.c index 388936e93ea..b5b3934039d 100644 --- a/gnu/usr.sbin/sendmail/libsmdb/smndbm.c +++ b/gnu/usr.sbin/sendmail/libsmdb/smndbm.c @@ -8,7 +8,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Sendmail: smndbm.c,v 8.47 2001/05/10 01:23:58 ca Exp $") +SM_RCSID("@(#)$Sendmail: smndbm.c,v 8.50 2001/09/11 04:04:53 gshapiro Exp $") #include <fcntl.h> #include <stdlib.h> @@ -37,7 +37,7 @@ struct smdb_dbm_cursor_struct }; typedef struct smdb_dbm_cursor_struct SMDB_DBM_CURSOR; -/* +/* ** SMDB_PUT_FLAGS_TO_NDBM_FLAGS -- Translates smdb put flags to ndbm put flags. ** ** Parameters: @@ -455,7 +455,7 @@ smdbm_cursor(database, cursor, flags) return SMDBE_OK; } -/* +/* ** SMDB_NDBM_OPEN -- Opens a ndbm database. ** ** Parameters: |