Changeset View
Changeset View
Standalone View
Standalone View
main_wayland.cpp
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | |||||
51 | // system | 51 | // system | ||
52 | #ifdef HAVE_UNISTD_H | 52 | #ifdef HAVE_UNISTD_H | ||
53 | #include <unistd.h> | 53 | #include <unistd.h> | ||
54 | #endif // HAVE_UNISTD_H | 54 | #endif // HAVE_UNISTD_H | ||
55 | 55 | | |||
56 | #if HAVE_SYS_PRCTL_H | 56 | #if HAVE_SYS_PRCTL_H | ||
57 | #include <sys/prctl.h> | 57 | #include <sys/prctl.h> | ||
58 | #endif | 58 | #endif | ||
59 | #if HAVE_SYS_PROCCTL_H | ||||
60 | #include <unistd.h> | ||||
61 | #include <sys/procctl.h> | ||||
62 | #endif | ||||
59 | 63 | | |||
60 | #include <iostream> | 64 | #include <iostream> | ||
61 | #include <iomanip> | 65 | #include <iomanip> | ||
62 | 66 | | |||
63 | namespace KWin | 67 | namespace KWin | ||
64 | { | 68 | { | ||
65 | 69 | | |||
66 | static void sighandler(int) | 70 | static void sighandler(int) | ||
▲ Show 20 Lines • Show All 331 Lines • ▼ Show 20 Line(s) | 399 | #if HAVE_PR_SET_DUMPABLE | |||
398 | if (parent.isSymLink() && parent.symLinkTarget().endsWith(QLatin1String("/gdb"))) { | 402 | if (parent.isSymLink() && parent.symLinkTarget().endsWith(QLatin1String("/gdb"))) { | ||
399 | // debugger, don't adjust | 403 | // debugger, don't adjust | ||
400 | return; | 404 | return; | ||
401 | } | 405 | } | ||
402 | 406 | | |||
403 | // disable ptrace in kwin_wayland | 407 | // disable ptrace in kwin_wayland | ||
404 | prctl(PR_SET_DUMPABLE, 0); | 408 | prctl(PR_SET_DUMPABLE, 0); | ||
405 | #endif | 409 | #endif | ||
410 | #if HAVE_PROC_TRACE_CTL | ||||
411 | // FreeBSD's rudimentary procfs does not support /proc/<pid>/exe | ||||
412 | // We could use the P_TRACED flag of the process to find out | ||||
413 | // if the process is being debugged ond FreeBSD. | ||||
414 | int mode = PROC_TRACE_CTL_DISABLE; | ||||
415 | procctl(P_PID, getpid(), PROC_TRACE_CTL, &mode); | ||||
416 | #endif | ||||
417 | | ||||
406 | } | 418 | } | ||
407 | 419 | | |||
408 | } // namespace | 420 | } // namespace | ||
409 | 421 | | |||
410 | int main(int argc, char * argv[]) | 422 | int main(int argc, char * argv[]) | ||
411 | { | 423 | { | ||
412 | KWin::disablePtrace(); | 424 | KWin::disablePtrace(); | ||
413 | KWin::Application::setupMalloc(); | 425 | KWin::Application::setupMalloc(); | ||
▲ Show 20 Lines • Show All 298 Lines • Show Last 20 Lines |