]> Zhao Yanbai Git Server - minix.git/commitdiff
err_code has to be preserved as well. Short term fix
authorThomas Veerman <thomas@minix3.org>
Tue, 25 Oct 2011 12:12:20 +0000 (12:12 +0000)
committerThomas Veerman <thomas@minix3.org>
Tue, 25 Oct 2011 12:12:20 +0000 (12:12 +0000)
servers/avfs/job.h
servers/avfs/worker.c

index bfcdc5b9e340dbebc6b9156a606e2ca5384410a3..046a11b30c1431f2983e922ba401cd7cb740514f 100644 (file)
@@ -4,6 +4,7 @@
 struct job {
   struct fproc *j_fp;
   message j_m_in;
+  int j_err_code;
   void *(*j_func)(void *arg);
   struct job *j_next;
 };
index b83a044d324405d939111d51d76950afac9c24ad..01ce6705bcd3ae006e7cad249296474ccd7b4693 100644 (file)
@@ -187,6 +187,7 @@ PRIVATE void append_job(struct job *job, void *(*func)(void *arg))
   new_job->j_m_in = m_in;
   new_job->j_func = func;
   new_job->j_next = NULL;
+  new_job->j_err_code = OK;
 
   /* Append to queue */
   tail = job;
@@ -216,6 +217,7 @@ PUBLIC void worker_start(void *(*func)(void *arg))
        worker->w_job.j_m_in = m_in;
        worker->w_job.j_func = func;
        worker->w_job.j_next = NULL;
+       worker->w_job.j_err_code = OK;
        worker_wake(worker);
        return;
   }
@@ -232,6 +234,7 @@ PUBLIC void worker_start(void *(*func)(void *arg))
        fp->fp_job.j_m_in = m_in;
        fp->fp_job.j_func = func;
        fp->fp_job.j_next = NULL;
+       fp->fp_job.j_err_code = OK;
        fp->fp_flags |= FP_PENDING;
        pending++;
   }
@@ -271,11 +274,13 @@ PUBLIC void worker_wait(void)
 
   worker = worker_self();
   worker->w_job.j_m_in = m_in; /* Store important global data */
+  worker->w_job.j_err_code = err_code;
   assert(fp == worker->w_job.j_fp);
   worker_sleep(worker);
   /* We continue here after waking up */
   fp = worker->w_job.j_fp;     /* Restore global data */
   m_in = worker->w_job.j_m_in;
+  err_code = worker->w_job.j_err_code;
   assert(worker->w_next == NULL);
 }