MCPcopy Create free account
hub / github.com/NetHack/NetHack / ghack_sig_handler

Function ghack_sig_handler

outdated/win/gnome/gnmain.c:545–570  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

543};
544
545static void
546ghack_sig_handler(int signum)
547{
548 int i;
549 uid_t uid, euid;
550 gid_t gid, egid;
551 uid = getuid();
552 euid = geteuid();
553 gid = getgid();
554 egid = getegid();
555 if (gid != egid)
556 setgid(gid);
557 if (uid != euid)
558 setuid(uid);
559 for (i = SIZE(ghack_chain) - 1; i >= 0; i--)
560 if (ghack_chain[i].signum == signum) {
561 ghack_chain[i].handler(signum);
562 break;
563 }
564 if (i < 0)
565 impossible("Unhandled ghack signal");
566 if (uid != euid)
567 setuid(euid);
568 if (gid != egid)
569 setgid(egid);
570}
571
572/* initialize gnome and fir up the main window */
573void

Callers

nothing calls this directly

Calls 2

getuidFunction · 0.85
impossibleFunction · 0.50

Tested by

no test coverage detected