--- archive.c 2000/12/13 15:35:14 1.2
+++ archive.c 2000/12/15 15:48:00 1.3
@@ -1,6 +1,6 @@
/*
$Source: /v/ossp/cvs/ossp-pkg/petidomo/archive.c,v $
- $Revision: 1.2 $
+ $Revision: 1.3 $
Copyright (C) 2000 by CyberSolutions GmbH, Germany.
@@ -65,44 +65,35 @@
path = text_easy_sprintf("lists/%s/%s", listname, ListConfig->archivepath);
path = xstrdup(path);
}
- debug((DEBUG_ARCHIVE, 2, "Our archive path is \"%s\".", path));
/* Check whether we have a file or a directory. */
if (stat(path, &sb) == 0 && (sb.st_mode & S_IFDIR) != 0) {
- /* Store the article to the current number into the directory. */
-
- debug((DEBUG_ARCHIVE, 3, "\"%s\" is a directory.", path));
-
/* Read the "active"-file to see at what article number we
were. */
filename = text_easy_sprintf("%s/.active", path);
fh = fopen(filename, "r");
- if (fh != NULL) {
+ if (fh != NULL)
+ {
fscanf(fh, "%u", &counter);
- debug((DEBUG_ARCHIVE, 5, ".active file contained '%u'.", counter));
fclose(fh);
- }
- else {
+ }
+ else
+ {
if (errno != ENOENT)
- syslog(LOG_ERR, "Failed to read file \"%s\": %m", filename);
+ syslog(LOG_ERR, "Failed to read file \"%s\": %m", filename);
else
- debug((DEBUG_ARCHIVE, 1, "File \".active\" did not exist."));
- counter = 0;
- }
+ counter = 0;
+ }
/* Store the article. */
do {
filename = text_easy_sprintf("%s/%u", path, counter);
- debug((DEBUG_ARCHIVE, 4, "Testing whether file \"%s\" exists already.",
- filename));
if (stat(filename, &sb) == -1) {
- debug((DEBUG_ARCHIVE, 7, "Nope, it doesn't."));
if (errno == ENOENT) {
- debug((DEBUG_ARCHIVE, 1, "Writing mail to file \"%s\".", filename));
fh = fopen(filename, "a");
if (fh != NULL) {
fprintf(fh, "From %s-owner@%s %s", listname, ListConfig->fqdn, date);
@@ -121,8 +112,6 @@
break;
}
}
- else
- debug((DEBUG_ARCHIVE, 7, "Yep, it does."));
} while (++counter); /* until break */
/* Write the current "active" number back to the file. */
@@ -132,7 +121,6 @@
fh = fopen(filename, "w");
if (fh != NULL) {
fprintf(fh, "%u", counter);
- debug((DEBUG_ARCHIVE, 5, "Wrote '%u' to .active file.", counter));
fclose(fh);
}
else
@@ -142,7 +130,6 @@
/* Simply append the article to this file. */
- debug((DEBUG_ARCHIVE, 1, "Appending mail to logfile \"%s\".", path));
fh = fopen(path, "a");
if (fh != NULL) {
/* Write an envelope first. */
|