summaryrefslogtreecommitdiff
path: root/source3/lib/pthreadpool/pthreadpool.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/pthreadpool/pthreadpool.c')
-rw-r--r--source3/lib/pthreadpool/pthreadpool.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source3/lib/pthreadpool/pthreadpool.c b/source3/lib/pthreadpool/pthreadpool.c
index c916dc0f8d..fffbd050df 100644
--- a/source3/lib/pthreadpool/pthreadpool.c
+++ b/source3/lib/pthreadpool/pthreadpool.c
@@ -285,16 +285,16 @@ static void pthreadpool_join_children(struct pthreadpool *pool)
* Fetch a finished job number from the signal pipe
*/
-int pthreadpool_finished_job(struct pthreadpool *pool)
+int pthreadpool_finished_job(struct pthreadpool *pool, int *jobid)
{
- int result;
+ int ret_jobid;
ssize_t nread;
nread = -1;
errno = EINTR;
while ((nread == -1) && (errno == EINTR)) {
- nread = read(pool->sig_pipe[0], &result, sizeof(int));
+ nread = read(pool->sig_pipe[0], &ret_jobid, sizeof(int));
}
if (nread == -1) {
return errno;
@@ -302,7 +302,8 @@ int pthreadpool_finished_job(struct pthreadpool *pool)
if (nread != sizeof(int)) {
return EINVAL;
}
- return result;
+ *jobid = ret_jobid;
+ return 0;
}
/*