Skip to content

Commit

Permalink
Merge pull request #83 from daniel-baumann/master
Browse files Browse the repository at this point in the history
Creating /dev/shm if its not existing, otherwise haveged fails to start.
  • Loading branch information
jirka-h authored Jan 20, 2025
2 parents 6dcc0bb + 0d97223 commit 4da4420
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/haveged.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,13 @@ int main(int argc, char **argv)
fprintf(stderr, "%s: disabling command mode for this instance\n", params->daemon);
}
}
/* Initilize named semaphore to synchronize command instances */
/* Initialize named semaphore to synchronize command instances */
if (mkdir("/dev/shm", 0755) != 0) {
if (errno != EEXIST) {
error_exit("Couldn't create /dev/shm directory: %s", strerror(errno));
}
}

sem = sem_open(SEM_NAME, O_CREAT, 0644, 1);
if (sem == NULL) {
fprintf(stderr, "Warning: Couldn't create named semaphore " SEM_NAME" error: %s", strerror(errno));
Expand Down

0 comments on commit 4da4420

Please sign in to comment.