| 34 | int HeadlessManager::sigterm_fd[2]; |
| 35 | |
| 36 | HeadlessManager::HeadlessManager(QObject *obj_parent) : |
| 37 | QObject(obj_parent) |
| 38 | { |
| 39 | if (::socketpair(AF_UNIX, SOCK_STREAM, 0, sighup_fd)) |
| 40 | qFatal("Couldn't create HUP socketpair"); |
| 41 | |
| 42 | if (::socketpair(AF_UNIX, SOCK_STREAM, 0, sigterm_fd)) |
| 43 | qFatal("Couldn't create TERM socketpair"); |
| 44 | |
| 45 | sn_hup = new QSocketNotifier(sighup_fd[1], QSocketNotifier::Read, this); |
| 46 | connect(sn_hup, &QSocketNotifier::activated, this, &HeadlessManager::handleSigHup); |
| 47 | sn_term = new QSocketNotifier(sigterm_fd[1], QSocketNotifier::Read, this); |
| 48 | connect(sn_term, &QSocketNotifier::activated, this, &HeadlessManager::handleSigTerm); |
| 49 | } |
| 50 | |
| 51 | HeadlessManager::~HeadlessManager() |
| 52 | { |
nothing calls this directly
no outgoing calls
no test coverage detected