yandere 가 더욱 집착하게 된 것이다#60
Open
logic-finder wants to merge 5 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the C yandere implementation to react to POSIX signals by switching the continuously printed “yandere-like” message, making the program harder to stop via common termination signals.
Changes:
- Adds
SIGINT,SIGQUIT, andSIGTERMhandlers that switch the printed message. - Introduces a shared
trigger_loop()infinite output loop usingfputs. - Centralizes message strings into a
msgs[]array.
Comments suppressed due to low confidence (2)
yandere/c/yandere.c:33
- The signal handlers call trigger_loop(), which uses fputs()/stdio and then loops forever. stdio functions are not async-signal-safe, and running nontrivial code (especially an infinite loop) inside a signal handler can lead to undefined behavior or deadlock. A safer design is to have the handler only set a global (volatile sig_atomic_t) state/message selector and return, and let the main printing loop observe that state and print accordingly (or use an async-signal-safe primitive like write()).
static inline void trigger_loop(const char *str) {
for (;;) fputs(str, stdout);
}
static inline void handle_sigint(int sig) {
(void) sig;
trigger_loop(msgs[1]);
}
yandere/c/yandere.c:22
- SIGTERM is being handled by switching into an infinite printing loop rather than terminating. In many environments SIGTERM is the standard way to stop a process (e.g., service managers, CI), so ignoring it can cause operational issues (hung shutdowns / forced kills). Consider not overriding SIGTERM, or handling it by cleaning up (if needed) and exiting.
signal(SIGQUIT, handle_sigquit);
signal(SIGTERM, handle_sigterm);
trigger_loop(msgs[0]);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
|
logic-finder
commented
May 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
벗어날 수 없는 것이다
것이다