Deleted Added
full compact
smdb2.c (98121) smdb2.c (110560)
1/*
2** Copyright (c) 1999-2002 Sendmail, Inc. and its suppliers.
3** All rights reserved.
4**
5** By using this file, you agree to the terms and conditions set
6** forth in the LICENSE file which can be found at the top level of
7** the sendmail distribution.
8*/
9
10#include <sm/gen.h>
1/*
2** Copyright (c) 1999-2002 Sendmail, Inc. and its suppliers.
3** All rights reserved.
4**
5** By using this file, you agree to the terms and conditions set
6** forth in the LICENSE file which can be found at the top level of
7** the sendmail distribution.
8*/
9
10#include <sm/gen.h>
11SM_RCSID("@(#)$Id: smdb2.c,v 8.72 2002/05/24 23:09:11 gshapiro Exp $")
11SM_RCSID("@(#)$Id: smdb2.c,v 8.72.2.4 2002/12/03 17:01:15 ca Exp $")
12
13#include <fcntl.h>
14#include <stdlib.h>
15#include <unistd.h>
16
17
18#include <sendmail/sendmail.h>
19#include <libsmdb/smdb.h>

--- 498 unchanged lines hidden (view full) ---

518 {
519 (void) (*db)->close(*db, 0);
520 *db = NULL;
521 return db2_error_to_smdb(result);
522 }
523 }
524 }
525
12
13#include <fcntl.h>
14#include <stdlib.h>
15#include <unistd.h>
16
17
18#include <sendmail/sendmail.h>
19#include <libsmdb/smdb.h>

--- 498 unchanged lines hidden (view full) ---

518 {
519 (void) (*db)->close(*db, 0);
520 *db = NULL;
521 return db2_error_to_smdb(result);
522 }
523 }
524 }
525
526 result = (*db)->open(*db, db_name, NULL, db_type, db_flags, DBMMODE);
526 result = (*db)->open(*db,
527 DBTXN /* transaction for DB 4.1 */
528 db_name, NULL, db_type, db_flags, DBMMODE);
527 if (result != 0)
528 {
529 (void) (*db)->close(*db, 0);
530 *db = NULL;
531 }
532 return db2_error_to_smdb(result);
533}
534# endif /* DB_VERSION_MAJOR > 2 */

--- 93 unchanged lines hidden (view full) ---

628
629 db_flags = 0;
630 if (bitset(O_CREAT, mode))
631 db_flags |= DB_CREATE;
632 if (bitset(O_TRUNC, mode))
633 db_flags |= DB_TRUNCATE;
634 if (mode == O_RDONLY)
635 db_flags |= DB_RDONLY;
529 if (result != 0)
530 {
531 (void) (*db)->close(*db, 0);
532 *db = NULL;
533 }
534 return db2_error_to_smdb(result);
535}
536# endif /* DB_VERSION_MAJOR > 2 */

--- 93 unchanged lines hidden (view full) ---

630
631 db_flags = 0;
632 if (bitset(O_CREAT, mode))
633 db_flags |= DB_CREATE;
634 if (bitset(O_TRUNC, mode))
635 db_flags |= DB_TRUNCATE;
636 if (mode == O_RDONLY)
637 db_flags |= DB_RDONLY;
636# if !HASFLOCK && defined(DB_FCNTL_LOCKING)
637 db_flags |= DB_FCNTL_LOCKING;
638# endif /* !HASFLOCK && defined(DB_FCNTL_LOCKING) */
638 SM_DB_FLAG_ADD(db_flags);
639
640 result = smdb_db_open_internal(db_file_name, db_type,
641 db_flags, db_params, &db);
642
643 if (result == 0 && db != NULL)
644 {
645 result = db->fd(db, &db_fd);
646 if (result == 0)

--- 47 unchanged lines hidden ---
639
640 result = smdb_db_open_internal(db_file_name, db_type,
641 db_flags, db_params, &db);
642
643 if (result == 0 && db != NULL)
644 {
645 result = db->fd(db, &db_fd);
646 if (result == 0)

--- 47 unchanged lines hidden ---