mcexec: Fix error handling of init_worker_threads
Refs: #1233 Change-Id: Icce49c996d69b3cf64a71e7bd470421f329c881f
This commit is contained in:
committed by
Dominique Martinet
parent
dbe5e99cf9
commit
da02f76a25
@@ -1487,8 +1487,9 @@ int init_worker_threads(int fd)
|
|||||||
int ret = create_worker_thread(NULL, &init_ready);
|
int ret = create_worker_thread(NULL, &init_ready);
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
printf("ERROR: creating syscall threads (%d), check ulimit?\n", ret);
|
printf("ERROR: creating worker threads (%d), check ulimit?\n",
|
||||||
return ret;
|
ret);
|
||||||
|
return -ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2757,8 +2758,9 @@ int main(int argc, char **argv)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (init_worker_threads(fd) < 0) {
|
if ((error = init_worker_threads(fd)) != 0) {
|
||||||
perror("worker threads: ");
|
fprintf(stderr, "%s: Error: creating worker threads: %s\n",
|
||||||
|
__func__, strerror(-error));
|
||||||
close(fd);
|
close(fd);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -3569,11 +3571,11 @@ gettid_out:
|
|||||||
n_threads = 4;
|
n_threads = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
if ((ret = init_worker_threads(fd)) != 0) {
|
||||||
if (init_worker_threads(fd) < 0) {
|
fprintf(stderr, "%s: Error: creating worker threads: %s\n",
|
||||||
perror("worker threads: ");
|
__func__, strerror(-ret));
|
||||||
close(fd);
|
close(fd);
|
||||||
ret = -1;
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
fork_child_sync_pipe:
|
fork_child_sync_pipe:
|
||||||
|
|||||||
Reference in New Issue
Block a user