Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,9 @@ void bioInit(void) {
* responsible for. */
for (j = 0; j < BIO_WORKER_NUM; j++) {
void *arg = (void *)(unsigned long)j;
if (pthread_create(&thread, &attr, bioProcessBackgroundJobs, arg) != 0) {
serverLog(LL_WARNING, "Fatal: Can't initialize Background Jobs. Error message: %s", strerror(errno));
int err = pthread_create(&thread, &attr, bioProcessBackgroundJobs, arg);
if (err) {
serverLog(LL_WARNING, "Fatal: Can't initialize Background Jobs. Error message: %s", strerror(err));
exit(1);
}
bio_threads[j] = thread;
Expand Down Expand Up @@ -239,8 +240,9 @@ void *bioProcessBackgroundJobs(void *arg) {
* receive the watchdog signal. */
sigemptyset(&sigset);
sigaddset(&sigset, SIGALRM);
if (pthread_sigmask(SIG_BLOCK, &sigset, NULL))
serverLog(LL_WARNING, "Warning: can't mask SIGALRM in bio.c thread: %s", strerror(errno));
int err = pthread_sigmask(SIG_BLOCK, &sigset, NULL);
if (err)
serverLog(LL_WARNING, "Warning: can't mask SIGALRM in bio.c thread: %s", strerror(err));

bio_thread_id = worker;

Expand Down
5 changes: 3 additions & 2 deletions src/io_threads.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,9 @@ static void createIOThread(int id) {
pthread_mutex_init(&io_threads_mutex[id], NULL);
IOJobQueue_init(&io_jobs[id], IO_JOB_QUEUE_SIZE);
pthread_mutex_lock(&io_threads_mutex[id]); /* Thread will be stopped. */
if (pthread_create(&tid, NULL, IOThreadMain, (void *)(long)id) != 0) {
serverLog(LL_WARNING, "Fatal: Can't initialize IO thread, pthread_create failed with: %s", strerror(errno));
int err = pthread_create(&tid, NULL, IOThreadMain, (void *)(long)id);
if (err) {
serverLog(LL_WARNING, "Fatal: Can't initialize IO thread, pthread_create failed with: %s", strerror(err));
exit(1);
}
io_threads[id] = tid;
Expand Down
Loading