[illumos-Developer] webrev: 374 cron should send more useful mail

Joerg Schilling Joerg.Schilling at fokus.fraunhofer.de
Tue Oct 26 02:00:25 PDT 2010


"Joshua M. Clulow" <josh at sysmgr.org> wrote:

> On Tue, Oct 26, 2010 at 4:45 PM, Garrett D'Amore <garrett at nexenta.com> wrote:
> > line 2250: why not just use strdup().  (What does xmalloc offer?  I need
> > to investigate further.)
>
> I've changed to strdup() in my workspace now.

strdup() is a really bad idea!

Better use xstrdup()

> > line 1292, 1293: given the release at 1305, what's the point of this
> > release?
>
> The crontab processing loop processes one line at a time (starts at
> ~1153).  Some of those lines are variables like HOME=, or newly
> MAIL_SUBJECT=, and the rest are crontab entries that describe jobs.
> HOME/SHELL/TZ, once set, affect all job entries that appear after
> their definition in the crontab.  I feel that MAIL_SUBJECT= should
> really only affect the job entry that appears directly after it, so
> I'm releasing and NULLing the variable that keeps track of it once an
> entry uses the value (lines 1292-1293).  I then release again at the
> bottom of readcron() because there are some cases where the code
> breaks out of the loop (mostly error handling cases).

I have headaches with this solution. It is not clean but rather rapes a method 
that was introduced in order to set up job independent environment variables 
for the current cron user.

Jörg

-- 
 EMail:joerg at schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js at cs.tu-berlin.de                (uni)  
       joerg.schilling at fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/private/ ftp://ftp.berlios.de/pub/schily



More information about the Developer mailing list