summaryrefslogtreecommitdiff
path: root/db2/progs
diff options
context:
space:
mode:
Diffstat (limited to 'db2/progs')
-rw-r--r--db2/progs/db_checkpoint/db_checkpoint.c25
-rw-r--r--db2/progs/db_deadlock/db_deadlock.c2
-rw-r--r--db2/progs/db_dump185/db_dump185.c4
-rw-r--r--db2/progs/db_load/db_load.c4
-rw-r--r--db2/progs/db_recover/db_recover.c3
5 files changed, 21 insertions, 17 deletions
diff --git a/db2/progs/db_checkpoint/db_checkpoint.c b/db2/progs/db_checkpoint/db_checkpoint.c
index 4f9b79a7ba..b2a692bba9 100644
--- a/db2/progs/db_checkpoint/db_checkpoint.c
+++ b/db2/progs/db_checkpoint/db_checkpoint.c
@@ -11,7 +11,7 @@
static const char copyright[] =
"@(#) Copyright (c) 1997\n\
Sleepycat Software Inc. All rights reserved.\n";
-static const char sccsid[] = "@(#)db_checkpoint.c 10.11 (Sleepycat) 8/27/97";
+static const char sccsid[] = "@(#)db_checkpoint.c 10.12 (Sleepycat) 9/4/97";
#endif
#ifndef NO_SYSTEM_INCLUDES
@@ -22,6 +22,7 @@ static const char sccsid[] = "@(#)db_checkpoint.c 10.11 (Sleepycat) 8/27/97";
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <time.h>
#include <unistd.h>
#endif
@@ -59,7 +60,7 @@ main(argc, argv)
DB_ENV *dbenv;
time_t now;
long kbytes, minutes, seconds;
- int ch, rval, verbose;
+ int ch, eval, verbose;
char *home, *logfile;
home = logfile = NULL;
@@ -110,7 +111,7 @@ main(argc, argv)
* to wake up when a checkpoint is necessary. If we have a "kbytes"
* field set, then we'll check every 30 seconds.
*/
- rval = 0;
+ eval = 0;
seconds = kbytes != 0 ? 30 : minutes * 60;
while (!interrupted) {
(void)__db_sleep(seconds, 0);
@@ -119,23 +120,25 @@ main(argc, argv)
(void)time(&now);
printf("checkpoint: %s", ctime(&now));
}
- rval = txn_checkpoint(dbenv->tx_info, kbytes, minutes);
- if (rval < 0)
- break;
+ errno = txn_checkpoint(dbenv->tx_info, kbytes, minutes);
- while (rval > 0) {
+ while (errno == DB_INCOMPLETE) {
if (verbose)
__db_err(dbenv,
"checkpoint did not finish, retrying");
(void)__db_sleep(2, 0);
- rval = txn_checkpoint(dbenv->tx_info, 0, 0);
+ errno = txn_checkpoint(dbenv->tx_info, 0, 0);
}
- if (rval < 0)
+
+ if (errno != 0) {
+ eval = 1;
+ __db_err(dbenv, "checkpoint: %s", strerror(errno));
break;
+ }
}
if (logfile != NULL && logpid(logfile, 0))
- rval = 1;
+ eval = 1;
if (interrupted) {
(void)signal(interrupted, SIG_DFL);
@@ -143,7 +146,7 @@ main(argc, argv)
/* NOTREACHED */
}
- return (db_appexit(dbenv) || rval ? 1 : 0);
+ return (db_appexit(dbenv) || eval ? 1 : 0);
}
/*
diff --git a/db2/progs/db_deadlock/db_deadlock.c b/db2/progs/db_deadlock/db_deadlock.c
index 09004f58b3..ec2b53dee7 100644
--- a/db2/progs/db_deadlock/db_deadlock.c
+++ b/db2/progs/db_deadlock/db_deadlock.c
@@ -11,7 +11,7 @@
static const char copyright[] =
"@(#) Copyright (c) 1997\n\
Sleepycat Software Inc. All rights reserved.\n";
-static const char sccsid[] = "@(#)db_deadlock.c 10.14 (Sleepycat) 8/27/97";
+static const char sccsid[] = "@(#)db_deadlock.c 10.15 (Sleepycat) 9/4/97";
#endif
#ifndef NO_SYSTEM_INCLUDES
diff --git a/db2/progs/db_dump185/db_dump185.c b/db2/progs/db_dump185/db_dump185.c
index 6e2d95bee0..5ec7673f1b 100644
--- a/db2/progs/db_dump185/db_dump185.c
+++ b/db2/progs/db_dump185/db_dump185.c
@@ -11,7 +11,7 @@
static const char copyright[] =
"@(#) Copyright (c) 1997\n\
Sleepycat Software Inc. All rights reserved.\n";
-static const char sccsid[] = "@(#)db_dump185.c 10.7 (Sleepycat) 8/27/97";
+static const char sccsid[] = "@(#)db_dump185.c 10.8 (Sleepycat) 9/21/97";
#endif
#ifndef NO_SYSTEM_INCLUDES
@@ -192,7 +192,7 @@ main(argc, argv)
if ((dbp = dbopen(argv[0], O_RDONLY, 0, DB_BTREE, NULL)) == NULL) {
if ((dbp = dbopen(argv[0], O_RDONLY, 0, DB_HASH, NULL)) == NULL)
- return (1);
+ err(1, "%s", argv[0]);
db_185_hash(dbp, pflag);
} else
db_185_btree(dbp, pflag);
diff --git a/db2/progs/db_load/db_load.c b/db2/progs/db_load/db_load.c
index 6f69216777..a1ebfa8a11 100644
--- a/db2/progs/db_load/db_load.c
+++ b/db2/progs/db_load/db_load.c
@@ -11,7 +11,7 @@
static const char copyright[] =
"@(#) Copyright (c) 1997\n\
Sleepycat Software Inc. All rights reserved.\n";
-static const char sccsid[] = "@(#)db_load.c 10.12 (Sleepycat) 8/28/97";
+static const char sccsid[] = "@(#)db_load.c 10.13 (Sleepycat) 9/15/97";
#endif
#ifndef NO_SYSTEM_INCLUDES
@@ -59,7 +59,7 @@ main(argc, argv)
char **clist, **clp, *home;
/* Allocate enough room for configuration arguments. */
- if ((clp = clist = calloc(argc + 1, sizeof(char *))) == NULL)
+ if ((clp = clist = (char **)calloc(argc + 1, sizeof(char *))) == NULL)
err(1, NULL);
home = NULL;
diff --git a/db2/progs/db_recover/db_recover.c b/db2/progs/db_recover/db_recover.c
index d17c4b0c76..55b9b49a79 100644
--- a/db2/progs/db_recover/db_recover.c
+++ b/db2/progs/db_recover/db_recover.c
@@ -11,7 +11,7 @@
static const char copyright[] =
"@(#) Copyright (c) 1997\n\
Sleepycat Software Inc. All rights reserved.\n";
-static const char sccsid[] = "@(#)db_recover.c 10.14 (Sleepycat) 8/27/97";
+static const char sccsid[] = "@(#)db_recover.c 10.15 (Sleepycat) 9/21/97";
#endif
#ifndef NO_SYSTEM_INCLUDES
@@ -24,6 +24,7 @@ static const char sccsid[] = "@(#)db_recover.c 10.14 (Sleepycat) 8/27/97";
#endif
#include "db_int.h"
+#include "shqueue.h"
#include "txn.h"
#include "common_ext.h"
#include "clib_ext.h"