Skip to content

yandere 가 더욱 집착하게 된 것이다#60

Open
logic-finder wants to merge 5 commits into
mainfrom
feat/yandere/capture-signals
Open

yandere 가 더욱 집착하게 된 것이다#60
logic-finder wants to merge 5 commits into
mainfrom
feat/yandere/capture-signals

Conversation

@logic-finder
Copy link
Copy Markdown
Contributor

벗어날 수 없는 것이다

것이다

@logic-finder logic-finder requested a review from lshqqytiger May 20, 2026 17:37
@logic-finder logic-finder self-assigned this May 20, 2026
@logic-finder logic-finder added the enhancement New feature or request label May 20, 2026
@lshqqytiger lshqqytiger requested a review from Copilot May 21, 2026 04:46
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and SIGTERM handlers that switch the printed message.
  • Introduces a shared trigger_loop() infinite output loop using fputs.
  • 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.

Comment thread yandere/c/yandere.c Outdated
Comment thread yandere/c/yandere.c Outdated
@logic-finder
Copy link
Copy Markdown
Contributor Author

logic-finder commented May 21, 2026

명세 고치기 vs 명세를 준수하지 않기

Comment thread yandere/c/yandere.c Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants