1 This patch makes the ext_todo patch work with Russell Nelson's
2 big-todo patch. Apply big-todo, then ext_todo, then this patch.
4 Please report any comments or bugs in this patch to
5 Andreas Aardal Hanssen <andreas@hanssen.name> (protected by tmda).
7 Updated 2002-07-12 17:17:00 CET: Removed last section in patch,
8 which caused message sizes to not get calculated.
11 diff -uN qmail-1.03/qmail-todo.c qmail-1.03-fixed/qmail-todo.c
12 --- qmail-1.03/qmail-todo.c Fri Jul 5 11:22:12 2002
13 +++ qmail-1.03-fixed/qmail-todo.c Fri Jul 5 11:18:27 2002
17 void fnmake_info(unsigned long id) { fn.len = fmtqfn(fn.s,"info/",id,1); }
18 -void fnmake_todo(unsigned long id) { fn.len = fmtqfn(fn.s,"todo/",id,0); }
19 +void fnmake_todo(unsigned long id) { fn.len = fmtqfn(fn.s,"todo/",id,1); }
20 void fnmake_mess(unsigned long id) { fn.len = fmtqfn(fn.s,"mess/",id,1); }
21 void fnmake_chanaddr(unsigned long id, int c)
22 { fn.len = fmtqfn(fn.s,chanaddr[c],id,1); }
24 /* this file is not too long ------------------------------------------ TODO */
26 datetime_sec nexttodorun;
27 -DIR *tododir; /* if 0, have to opendir again */
28 +int flagtododir = 0; /* if 0, have to readsubdir_init again */
29 +readsubdir todosubdir;
30 stralloc todoline = {0};
31 char todobuf[SUBSTDIO_INSIZE];
32 char todobufinfo[512];
44 if (flagexitasap) return;
45 trigger_selprep(nfds,rfds);
46 - if (tododir) *wakeup = 0;
47 + if (flagtododir) *wakeup = 0;
48 if (*wakeup > nexttodorun) *wakeup = nexttodorun;
63 if (flagexitasap) return;
68 if (!trigger_pulled(rfds))
69 if (recent < nexttodorun)
72 - tododir = opendir("todo");
78 + readsubdir_init(&todosubdir, "todo", pausedir);
80 nexttodorun = recent + SLEEP_TODO;
83 - d = readdir(tododir);
85 + switch(readsubdir_next(&todosubdir, &id))
97 - if (str_equal(d->d_name,".")) return;
98 - if (str_equal(d->d_name,"..")) return;
99 - len = scan_ulong(d->d_name,&id);
100 - if (!len || d->d_name[len]) return;