Conditionalise all debug strings.

This commit is contained in:
Richard Levitte 2003-04-03 18:07:39 +00:00
parent f85b68cd49
commit 63b6fe2bf6
2 changed files with 18 additions and 0 deletions

View File

@ -1709,7 +1709,9 @@ int save_index(char *dbfile, char *suffix, CA_DB *db)
#else #else
j = BIO_snprintf(buf[0], sizeof buf[0], "%s-%s", dbfile, suffix); j = BIO_snprintf(buf[0], sizeof buf[0], "%s-%s", dbfile, suffix);
#endif #endif
#ifdef RL_DEBUG
BIO_printf(bio_err, "DEBUG: writing \"%s\"\n", buf[0]); BIO_printf(bio_err, "DEBUG: writing \"%s\"\n", buf[0]);
#endif
if (BIO_write_filename(out,buf[0]) <= 0) if (BIO_write_filename(out,buf[0]) <= 0)
{ {
perror(dbfile); perror(dbfile);
@ -1722,7 +1724,9 @@ int save_index(char *dbfile, char *suffix, CA_DB *db)
BIO_free(out); BIO_free(out);
out = BIO_new(BIO_s_file()); out = BIO_new(BIO_s_file());
#ifdef RL_DEBUG
BIO_printf(bio_err, "DEBUG: writing \"%s\"\n", buf[1]); BIO_printf(bio_err, "DEBUG: writing \"%s\"\n", buf[1]);
#endif
if (BIO_write_filename(out,buf[1]) <= 0) if (BIO_write_filename(out,buf[1]) <= 0)
{ {
perror(buf[2]); perror(buf[2]);
@ -1796,8 +1800,10 @@ int rotate_index(char *dbfile, char *new_suffix, char *old_suffix)
} }
else else
{ {
#ifdef RL_DEBUG
BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n", BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n",
dbfile, buf[1]); dbfile, buf[1]);
#endif
if (rename(dbfile,buf[1]) < 0) if (rename(dbfile,buf[1]) < 0)
{ {
BIO_printf(bio_err, BIO_printf(bio_err,
@ -1807,8 +1813,10 @@ int rotate_index(char *dbfile, char *new_suffix, char *old_suffix)
goto err; goto err;
} }
} }
#ifdef RL_DEBUG
BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n", BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n",
buf[0],dbfile); buf[0],dbfile);
#endif
if (rename(buf[0],dbfile) < 0) if (rename(buf[0],dbfile) < 0)
{ {
BIO_printf(bio_err, BIO_printf(bio_err,
@ -1828,8 +1836,10 @@ int rotate_index(char *dbfile, char *new_suffix, char *old_suffix)
} }
else else
{ {
#ifdef RL_DEBUG
BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n", BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n",
buf[4],buf[3]); buf[4],buf[3]);
#endif
if (rename(buf[4],buf[3]) < 0) if (rename(buf[4],buf[3]) < 0)
{ {
BIO_printf(bio_err, BIO_printf(bio_err,
@ -1841,8 +1851,10 @@ int rotate_index(char *dbfile, char *new_suffix, char *old_suffix)
goto err; goto err;
} }
} }
#ifdef RL_DEBUG
BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n", BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n",
buf[2],buf[4]); buf[2],buf[4]);
#endif
if (rename(buf[2],buf[4]) < 0) if (rename(buf[2],buf[4]) < 0)
{ {
BIO_printf(bio_err, BIO_printf(bio_err,

View File

@ -640,7 +640,9 @@ bad:
p = NCONF_get_string(conf, section, "unique_subject"); p = NCONF_get_string(conf, section, "unique_subject");
if (p) if (p)
{ {
#ifdef RL_DEBUG
BIO_printf(bio_err, "DEBUG: unique_subject = \"%s\"\n", p); BIO_printf(bio_err, "DEBUG: unique_subject = \"%s\"\n", p);
#endif
switch(*p) switch(*p)
{ {
case 'f': /* false */ case 'f': /* false */
@ -658,10 +660,14 @@ bad:
break; break;
} }
} }
#ifdef RL_DEBUG
else else
BIO_printf(bio_err, "DEBUG: unique_subject undefined\n", p); BIO_printf(bio_err, "DEBUG: unique_subject undefined\n", p);
#endif
#ifdef RL_DEBUG
BIO_printf(bio_err, "DEBUG: configured unique_subject is %d\n", BIO_printf(bio_err, "DEBUG: configured unique_subject is %d\n",
db_attr.unique_subject); db_attr.unique_subject);
#endif
in=BIO_new(BIO_s_file()); in=BIO_new(BIO_s_file());
out=BIO_new(BIO_s_file()); out=BIO_new(BIO_s_file());