From 7bfb0c69d91e78adbe259094b5d9b8b4e5bd1103 Mon Sep 17 00:00:00 2001 From: gpalmer Date: Fri, 12 Jul 1996 13:12:46 +0000 Subject: Small changes so that this actually stands a chance of doing the right thing... --- usr.sbin/ctm/ctm_dequeue/ctm_dequeue.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/ctm/ctm_dequeue/ctm_dequeue.c b/usr.sbin/ctm/ctm_dequeue/ctm_dequeue.c index 9d10fc5..a3faf27 100644 --- a/usr.sbin/ctm/ctm_dequeue/ctm_dequeue.c +++ b/usr.sbin/ctm/ctm_dequeue/ctm_dequeue.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: ctm_dequeue.c,v 1.1 1996/07/01 20:53:55 gpalmer Exp $ */ /* @@ -116,7 +116,7 @@ main(int argc, char **argv) while(((!ISFILE) || (IGNORE)) && (HASNEXT)) ftsent = ftsent->fts_link; - if ((!ISFILE) || (IGNORE) || (!HASNEXT)) + if ((!ISFILE) || (IGNORE)) { err("No more chunks to mail"); exit(0); @@ -159,12 +159,21 @@ main(int argc, char **argv) munmap(buffer, ftsent->fts_statp->st_size); close(fp); + + if (unlink(filename) < 0) + { + err("unlink of `%s' failed", filename); + exit(1); + } err("sent file `%s'", ftsent->fts_name); if (ftsent->fts_link != NULL) ftsent = ftsent->fts_link; + else + break; } + err("exiting normally"); return(0); } -- cgit v1.1