X-Git-Url: https://git.distorted.org.uk/~mdw/fwd/blobdiff_plain/48bb1f76fd805b19aa32a374a8a9d8106ab7f420..bdbbfcd4eb2f6e15270f558342630d964cb9f418:/file.c diff --git a/file.c b/file.c index 300ac04..371273e 100644 --- a/file.c +++ b/file.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: file.c,v 1.1 1999/07/26 23:33:32 mdw Exp $ + * $Id: file.c,v 1.6 2003/11/29 20:36:07 mdw Exp $ * * File source and target * @@ -29,6 +29,21 @@ /*----- Revision history --------------------------------------------------* * * $Log: file.c,v $ + * Revision 1.6 2003/11/29 20:36:07 mdw + * Privileged outgoing connections. + * + * Revision 1.5 2002/02/22 23:43:32 mdw + * Call @xfree@ rather than @free@. + * + * Revision 1.4 2001/02/03 20:30:03 mdw + * Support re-reading config files on SIGHUP. + * + * Revision 1.3 1999/12/22 15:43:47 mdw + * Fix log messages. + * + * Revision 1.2 1999/10/22 22:47:13 mdw + * New (empty) endpoint method required. + * * Revision 1.1 1999/07/26 23:33:32 mdw * New sources and targets. * @@ -142,7 +157,7 @@ static void fept_close(endpt *e) /* --- Endpoint operations table --- */ -static endpt_ops fept_ops = { 0, fept_wclose, fept_close }; +static endpt_ops fept_ops = { 0, 0, fept_wclose, fept_close }; /*----- General operations on sources and targets -------------------------*/ @@ -435,7 +450,7 @@ static endpt *file_endpt(fdata *f, const char *desc) if (fd != -1) { if (fattr_apply(f->out.u.name, &f->fa)) { - fw_log(-1, "[%s] couldn't apply file attributes: %s", + fw_log(-1, "[%s] couldn't apply file attributes to `%s': %s", desc, f->out.u.name, strerror(errno)); } } else if ((fd = open(f->out.u.name, m & ~O_CREAT)) < 0) { @@ -468,9 +483,9 @@ static endpt *file_endpt(fdata *f, const char *desc) static void file_destroy(fdata *f) { if (f->in.type == FTYPE_NAME) - free(f->in.u.name); + xfree(f->in.u.name); if (f->out.type == FTYPE_NAME) - free(f->out.u.name); + xfree(f->out.u.name); } /*----- File source description -------------------------------------------*/ @@ -540,8 +555,7 @@ tidy: static void fsource_destroy(source *s) { fsource *fs = (fsource *)s; - - /* free(fs->s.desc); */ + xfree(fs->s.desc); file_destroy(&fs->f); DESTROY(fs); } @@ -596,7 +610,7 @@ static void ftarget_destroy(target *t) { ftarget *ft = (ftarget *)t; file_destroy(&ft->f); - /* free(ft->t.desc); */ + xfree(ft->t.desc); DESTROY(ft); } @@ -604,7 +618,7 @@ static void ftarget_destroy(target *t) target_ops ftarget_ops = { "file", - ftarget_option, ftarget_read, ftarget_create, ftarget_destroy + ftarget_option, ftarget_read, 0, ftarget_create, ftarget_destroy }; /*----- That's all, folks -------------------------------------------------*/