aboutsummaryrefslogtreecommitdiff
path: root/src/job.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/job.c')
-rw-r--r--src/job.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/job.c b/src/job.c
index 4a97f88..3fae432 100644
--- a/src/job.c
+++ b/src/job.c
@@ -22,24 +22,25 @@
#define STATE_ACTIVE 0x04
struct job
{
struct job *next, *prev;
int state;
- const struct spool *spool;
+ struct spool *spool;
uid_t uid;
pid_t pid;
time_t timestamp;
int exit_status;
};
struct job *queue;
size_t jobmax;
size_t jobcnt;
-static struct spool fake_spool = { "all spools" };
+struct spool fake_spool = { "all spools" },
+ inotify_spool = { "inotify" } ;
static int wakeup;
RETSIGTYPE
queue_signal (int sig)
{
@@ -73,19 +74,28 @@ job_active_count ()
for (job = queue; job; job = job->next)
if (job->state & STATE_ACTIVE)
count++;
return count;
}
+static int
+procspool (struct spool *spool, void *data)
+{
+ spool_commit_triplets (spool);
+ return 0;
+}
+
int
wydawca_scanner (struct job *job)
{
int rc;
initstats();
timer_start ("wydawca");
- if (job->spool == &fake_spool)
+ if (job->spool == &inotify_spool)
+ rc = for_each_spool (procspool, NULL);
+ else if (job->spool == &fake_spool)
rc = scan_all_spools (1, &job->uid);
else
{
spool_create_timers ();
rc = scan_spool (job->spool, 1, &job->uid);
}
@@ -188,13 +198,13 @@ job_insert (struct job *job, struct job *elt)
if (p)
p->prev = job;
}
void
-schedule_job (const struct spool *spool, uid_t uid)
+schedule_job (struct spool *spool, uid_t uid)
{
struct job *job;
if (!spool)
spool = &fake_spool;

Return to:

Send suggestions and report system problems to the System administrator.