Re: [hackers] [scron] [PATCH 3/3] Keep existing crontab entries if loading new entries fails

From: Lucas Gabriel Vuotto <lvuotto92_AT_gmail.com>
Date: Tue, 11 Jul 2017 11:36:45 -0300

I like the idea of this patch. There're two little details marked below.

> _AT_@ -391,7 +379,7 @@ freecte(struct ctabentry *cte, int nfields)
> }
>
> static void
> -unloadentries(void)
> +unloadentries(struct ctabentry *ctab)

Shadowing variables is error prone. In this case, this will happen if the first patch is merged, to which I oppose, given that there is nothing wrong with queue.h macros.

> _AT_@ -492,14 +483,6 @@ loadentries(void)
> }
>
> static void
> -reloadentries(void)
> -{
> - unloadentries();
> - if (loadentries() < 0)
> - logwarn("warning: discarding old crontab entries\n");
> -}
> -
> -static void> sighandler(int sig)
> {
> switch (sig) {

Somehow, the sysadmin should be informed that loadentries failed. Either keep reloadentries or log the failure in main.
Received on Tue Jul 11 2017 - 16:36:45 CEST

This archive was generated by hypermail 2.3.0 : Tue Jul 11 2017 - 16:49:21 CEST