diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2007-07-16 16:48:14 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2007-07-16 16:48:14 +0300 |
commit | 2cfd3012bfcb5c5c61bbaf662ef084e0ab789d79 (patch) | |
tree | e12ee52087506ac8c7a5eee83b17497d98df2d40 /db/db_recover | |
parent | b754fe19fd387ca5fe8e7c00ddaa25c898fa192f (diff) | |
download | librpm-tizen-2cfd3012bfcb5c5c61bbaf662ef084e0ab789d79.tar.gz librpm-tizen-2cfd3012bfcb5c5c61bbaf662ef084e0ab789d79.tar.bz2 librpm-tizen-2cfd3012bfcb5c5c61bbaf662ef084e0ab789d79.zip |
Update internal BDB to version 4.5.20
Diffstat (limited to 'db/db_recover')
-rw-r--r-- | db/db_recover/db_recover.c | 62 |
1 files changed, 23 insertions, 39 deletions
diff --git a/db/db_recover/db_recover.c b/db/db_recover/db_recover.c index 75961f78c..4082279a8 100644 --- a/db/db_recover/db_recover.c +++ b/db/db_recover/db_recover.c @@ -1,44 +1,27 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. * - * $Id: db_recover.c,v 11.41 2004/01/28 03:36:00 bostic Exp $ + * $Id: db_recover.c,v 12.9 2006/08/26 09:23:13 bostic Exp $ */ #include "db_config.h" +#include "db_int.h" + #ifndef lint static const char copyright[] = - "Copyright (c) 1996-2004\nSleepycat Software Inc. All rights reserved.\n"; -#endif - -#ifndef NO_SYSTEM_INCLUDES -#include <sys/types.h> - -#if TIME_WITH_SYS_TIME -#include <sys/time.h> -#include <time.h> -#else -#if HAVE_SYS_TIME_H -#include <sys/time.h> -#else -#include <time.h> -#endif + "Copyright (c) 1996-2006\nOracle Corporation. All rights reserved.\n"; #endif -#include <stdlib.h> -#include <string.h> -#include <unistd.h> -#endif - -#include "db_int.h" - int main __P((int, char *[])); -int read_timestamp __P((const char *, char *, time_t *)); +int read_timestamp __P((char *, time_t *)); int usage __P((void)); -int version_check __P((const char *)); +int version_check __P((void)); + +const char *progname; int main(argc, argv) @@ -47,14 +30,18 @@ main(argc, argv) { extern char *optarg; extern int optind; - const char *progname = "db_recover"; DB_ENV *dbenv; time_t timestamp; u_int32_t flags; int ch, exitval, fatal_recover, ret, retain_env, verbose; char *home, *passwd; - if ((ret = version_check(progname)) != 0) + if ((progname = strrchr(argv[0], '/')) == NULL) + progname = argv[0]; + else + ++progname; + + if ((ret = version_check()) != 0) return (ret); home = passwd = NULL; @@ -81,8 +68,7 @@ main(argc, argv) } break; case 't': - if ((ret = - read_timestamp(progname, optarg, ×tamp)) != 0) + if ((ret = read_timestamp(optarg, ×tamp)) != 0) return (ret); break; case 'V': @@ -142,10 +128,10 @@ main(argc, argv) * certainly use DB_CONFIG files in the directory. */ flags = 0; - LF_SET(DB_CREATE | DB_INIT_LOCK | DB_INIT_LOG | + LF_SET(DB_CREATE | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN | DB_USE_ENVIRON); LF_SET(fatal_recover ? DB_RECOVER_FATAL : DB_RECOVER); - LF_SET(retain_env ? 0 : DB_PRIVATE); + LF_SET(retain_env ? DB_INIT_LOCK : DB_PRIVATE); if ((ret = dbenv->open(dbenv, home, flags, 0)) != 0) { dbenv->err(dbenv, ret, "DB_ENV->open"); goto shutdown; @@ -204,8 +190,7 @@ shutdown: exitval = 1; * SUCH DAMAGE. */ int -read_timestamp(progname, arg, timep) - const char *progname; +read_timestamp(arg, timep) char *arg; time_t *timep; { @@ -276,14 +261,13 @@ terr: fprintf(stderr, int usage() { - (void)fprintf(stderr, "%s\n", -"usage: db_recover [-ceVv] [-h home] [-P password] [-t [[CC]YY]MMDDhhmm[.SS]]"); + (void)fprintf(stderr, "usage: %s %s\n", progname, + "[-ceVv] [-h home] [-P password] [-t [[CC]YY]MMDDhhmm[.SS]]"); return (EXIT_FAILURE); } int -version_check(progname) - const char *progname; +version_check() { int v_major, v_minor, v_patch; |