X-Git-Url: https://git.distorted.org.uk/~mdw/secnet/blobdiff_plain/64f5ae57aece3480ab79a93fc1b310e8b5ce22e9..86420bb75f19f628ffd2d8ff9964e59ed99e3187:/secnet.c diff --git a/secnet.c b/secnet.c index 024744c..8fb8aff 100644 --- a/secnet.c +++ b/secnet.c @@ -1,3 +1,22 @@ +/* + * This file is part of secnet. + * See README for full list of copyright holders. + * + * secnet is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version d of the License, or + * (at your option) any later version. + * + * secnet is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * version 3 along with secnet; if not, see + * https://www.gnu.org/licenses/gpl.html. + */ + #include "secnet.h" #include #include @@ -235,7 +254,7 @@ struct poll_interest *register_for_poll(void *st, beforepoll_fn *before, { struct poll_interest *i; - i=safe_malloc(sizeof(*i),"register_for_poll"); + NEW(i); i->before=before; i->after=after; i->state=st; @@ -331,7 +350,7 @@ static void run(void) if (shortfall) { allocdfds *= 2; allocdfds += shortfall; - fds=safe_realloc_ary(fds,sizeof(*fds),allocdfds, "run"); + REALLOC_ARY(fds,allocdfds); } shortfall=0; idx=0; @@ -475,6 +494,8 @@ int main(int argc, char **argv) { dict_t *config; + phase_hooks_init(); + enter_phase(PHASE_GETOPTS); parse_options(argc,argv);