diff options
Diffstat (limited to 'src/job.c')
-rw-r--r-- | src/job.c | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -25,7 +25,7 @@ struct job | |||
25 | { | 25 | { |
26 | struct job *next, *prev; | 26 | struct job *next, *prev; |
27 | int state; | 27 | int state; |
28 | const struct spool *spool; | 28 | struct spool *spool; |
29 | uid_t uid; | 29 | uid_t uid; |
30 | pid_t pid; | 30 | pid_t pid; |
31 | time_t timestamp; | 31 | time_t timestamp; |
@@ -36,7 +36,8 @@ struct job *queue; | |||
36 | size_t jobmax; | 36 | size_t jobmax; |
37 | size_t jobcnt; | 37 | size_t jobcnt; |
38 | 38 | ||
39 | static struct spool fake_spool = { "all spools" }; | 39 | struct spool fake_spool = { "all spools" }, |
40 | inotify_spool = { "inotify" } ; | ||
40 | 41 | ||
41 | static int wakeup; | 42 | static int wakeup; |
42 | 43 | ||
@@ -76,13 +77,22 @@ job_active_count () | |||
76 | return count; | 77 | return count; |
77 | } | 78 | } |
78 | 79 | ||
80 | static int | ||
81 | procspool (struct spool *spool, void *data) | ||
82 | { | ||
83 | spool_commit_triplets (spool); | ||
84 | return 0; | ||
85 | } | ||
86 | |||
79 | int | 87 | int |
80 | wydawca_scanner (struct job *job) | 88 | wydawca_scanner (struct job *job) |
81 | { | 89 | { |
82 | int rc; | 90 | int rc; |
83 | initstats(); | 91 | initstats(); |
84 | timer_start ("wydawca"); | 92 | timer_start ("wydawca"); |
85 | if (job->spool == &fake_spool) | 93 | if (job->spool == &inotify_spool) |
94 | rc = for_each_spool (procspool, NULL); | ||
95 | else if (job->spool == &fake_spool) | ||
86 | rc = scan_all_spools (1, &job->uid); | 96 | rc = scan_all_spools (1, &job->uid); |
87 | else | 97 | else |
88 | { | 98 | { |
@@ -191,7 +201,7 @@ job_insert (struct job *job, struct job *elt) | |||
191 | } | 201 | } |
192 | 202 | ||
193 | void | 203 | void |
194 | schedule_job (const struct spool *spool, uid_t uid) | 204 | schedule_job (struct spool *spool, uid_t uid) |
195 | { | 205 | { |
196 | struct job *job; | 206 | struct job *job; |
197 | 207 | ||