vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Gregory Hinton wrote: > On 3/19/07, Han Boetes <han@mijncomputer.nl> wrote: > > I just had two cronjobs which were set on the same time and > > the first match was executed and the second was ignored. > > Maybe I misunderstand your description of the problem, but it > seems to work fine for me using recent -current code: > [snip: output of test] Yes with that job I get the same result. I must be observing something else. > > Another thing, crontab -l shows this header. > > > > # DO NOT EDIT THIS FILE - edit the master and reinstall. > > # (/tmp/crontab.hwekl21478 installed on Tue Mar 20 03:34:00 2007) > > # (Cron version V5.0 -- $OpenBSD: crontab.c,v 1.51 2007/02/19 00:08:38 jmc > > Exp $) > > > > Wouldn't it be nicer to skip this header? > > Yes, perhaps this header would in fact confuse noobs, but isn't > that part of official obsd policy? It is, so I doubt they like this patch, but I attempt it anyway. :-) Index: crontab.c ================================================== ================= RCS file: /cvs/src/usr.sbin/cron/crontab.c,v retrieving revision 1.51 diff -u -p -u -p -w -r1.51 crontab.c --- crontab.c 19 Feb 2007 00:08:38 -0000 1.51 +++ crontab.c 20 Mar 2007 11:31:38 -0000 @@ -229,7 +229,7 @@ static void list_cmd(void) { char n[MAX_FNAME]; FILE *f; - int ch; + int ch, rets = 0; log_it(RealUser, Pid, "LIST", User); if (snprintf(n, sizeof n, "%s/%s", SPOOL_DIR, User) >= sizeof(n)) { @@ -244,11 +244,15 @@ list_cmd(void) { exit(ERROR_EXIT); } - /* file is open. copy to stdout, close. + /* file is open. skip headerlines, copy to stdout, close. */ Set_LineNum(1) - while (EOF != (ch = get_char(f))) + while (EOF != (ch = get_char(f))) { + if (rets > NHEADER_LINES) putchar(ch); + if (ch == '\n') + rets++; + } fclose(f); } # Han |
| Thread Tools | |
| Display Modes | |
|
|