aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-02-22 15:40:48 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2009-02-22 15:40:48 +0200
commitcc980787791b10c2a8e95e07d40973861e00a8d9 (patch)
tree86b162b126a52ec9202d7526eaad5efb0df25a21
parentf09763f6b6e1e84ea9968457e6cc3e7af5360671 (diff)
downloadwydawca-cc980787791b10c2a8e95e07d40973861e00a8d9.tar.gz
wydawca-cc980787791b10c2a8e95e07d40973861e00a8d9.tar.bz2
Minor fixes
-rw-r--r--src/Makefile.am2
-rw-r--r--src/null.c13
2 files changed, 13 insertions, 2 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index bf38ec8..7ba9832 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -42,7 +42,7 @@ wydawca_SOURCES=\
report.c
BUILT_SOURCES=cmdline.h
-EXTRA_DIST=cmdline.opt getopt.m4 pp-setup
+EXTRA_DIST=cmdline.opt getopt.m4 pp-setup update-2.0.awk
SUFFIXES=.opt .c .h
diff --git a/src/null.c b/src/null.c
index 667f229..5ec85f3 100644
--- a/src/null.c
+++ b/src/null.c
@@ -20,9 +20,17 @@ int
null_move_file (struct file_triplet *trp, struct spool *spool,
enum file_type file_id, const char *reldir)
{
+ const char *file_name = trp->file[file_id].name;
if (debug_level)
logmsg (LOG_DEBUG, "%s: installing file `%s/%s'",
- spool->url, reldir, trp->file[file_id].name);
+ spool->url, reldir, file_name);
+ UPDATE_STATS (STAT_UPLOADS);
+ if (unlink (file_name))
+ {
+ logmsg (LOG_ERR, "Cannot unlink %s: %s",
+ file_name, strerror (errno));
+ return 1;
+ }
return 0;
}
@@ -32,6 +40,7 @@ null_archive_file (struct file_triplet *trp, struct spool *spool,
{
if (debug_level)
logmsg (LOG_DEBUG, "%s: archiving `%s'", spool->url, file_name);
+ UPDATE_STATS (STAT_ARCHIVES);
return 0;
}
@@ -43,6 +52,7 @@ null_symlink_file (struct file_triplet *trp, struct spool *spool,
if (debug_level)
logmsg (LOG_DEBUG, "%s: symlinking `%s' to `%s'",
spool->url, wanted_src, wanted_dst);
+ UPDATE_STATS (STAT_SYMLINKS);
return 0;
}
@@ -53,6 +63,7 @@ null_rmsymlink_file (struct file_triplet *trp, struct spool *spool,
if (debug_level)
logmsg (LOG_DEBUG, "%s: removing symlink `%s/%s'",
spool->url, reldir, file_name);
+ UPDATE_STATS (STAT_RMSYMLINKS);
return 0;
}

Return to:

Send suggestions and report system problems to the System administrator.