summaryrefslogtreecommitdiff
path: root/job.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-01-23 22:56:47 +0100
committerLennart Poettering <lennart@poettering.net>2010-01-23 22:56:47 +0100
commit83c60c9f0c7581b607dc5c0f84582978894e3d4a (patch)
tree9c6dc95ae4ca7e64ffc674cb45561dd52dcaa10f /job.c
parent542563babda739f7aee468c3eaaab6315ffa4224 (diff)
implement proper binding on ports
Diffstat (limited to 'job.c')
-rw-r--r--job.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/job.c b/job.c
index 0ae1a765fb..7accf7267b 100644
--- a/job.c
+++ b/job.c
@@ -362,6 +362,8 @@ int job_run_and_invalidate(Job *j) {
if (j->state != JOB_WAITING)
return 0;
+ j->state = JOB_RUNNING;
+
switch (j->type) {
case JOB_START:
@@ -422,11 +424,12 @@ int job_run_and_invalidate(Job *j) {
;
}
- if (r >= 0)
- j->state = JOB_RUNNING;
- else if (r == -EALREADY)
+ if (r == -EALREADY)
r = job_finish_and_invalidate(j, true);
- else if (r != -EAGAIN)
+ else if (r == -EAGAIN) {
+ j->state = JOB_WAITING;
+ return -EAGAIN;
+ } else if (r < 0)
r = job_finish_and_invalidate(j, false);
return r;