Skip to content

Conversation

robo-monk
Copy link

Using a debugger such as GDB or CodeLLDB on a program that uses nob.h and depends something like this:

if (!nob_cmd_run(&cmd)) {
    fatal("Failed to run command");
  };

causes the debugging process to detach because of:

[ERROR] could not wait on command (pid 16237): Interrupted system call

This happens when a signal interrupts the waitpid() call, setting errno to EINTR.

This fix adds a retry logic for waitpid() to correctly handle EINTR, ensuring the command wait loop resumes normally instead of treating it as a fatal error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant