src: Yearly copyright bump
[quassel.git] / src / common / posixsignalwatcher.cpp
index 7de0e77..9faf5ed 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2018 by the Quassel Project                        *
+ *   Copyright (C) 2005-2020 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
 
 #include "posixsignalwatcher.h"
 
+#include <sys/resource.h>
 #include <sys/socket.h>
-#include <sys/types.h>
 #include <sys/time.h>
-#include <sys/resource.h>
+#include <sys/types.h>
 #include <unistd.h>
 
 #include <cerrno>
 #include <QDebug>
 #include <QSocketNotifier>
 
-#include "logmessage.h"
-
 int PosixSignalWatcher::_sockpair[2];
 
-PosixSignalWatcher::PosixSignalWatcher(QObject *parent)
+PosixSignalWatcher::PosixSignalWatcher(QObjectparent)
     : AbstractSignalWatcher{parent}
 {
     if (::socketpair(AF_UNIX, SOCK_STREAM, 0, _sockpair)) {
@@ -45,7 +43,7 @@ PosixSignalWatcher::PosixSignalWatcher(QObject *parent)
     }
 
     _notifier = new QSocketNotifier(_sockpair[1], QSocketNotifier::Read, this);
-    connect(_notifier, SIGNAL(activated(int)), this, SLOT(onNotify(int)));
+    connect(_notifier, &QSocketNotifier::activated, this, &PosixSignalWatcher::onNotify);
     _notifier->setEnabled(true);
 
     registerSignal(SIGINT);
@@ -54,7 +52,7 @@ PosixSignalWatcher::PosixSignalWatcher(QObject *parent)
 
 #ifdef HAVE_BACKTRACE
     // we only handle crashes ourselves if coredumps are disabled
-    struct rlimit *limit = (rlimit *)malloc(sizeof(struct rlimit));
+    struct rlimit* limit = (rlimit*)malloc(sizeof(struct rlimit));
     int rc = getrlimit(RLIMIT_CORE, limit);
     if (rc == -1 || !((long)limit->rlim_cur > 0 || limit->rlim_cur == RLIM_INFINITY)) {
         registerSignal(SIGABRT);
@@ -88,7 +86,7 @@ void PosixSignalWatcher::onNotify(int sockfd)
     int signal;
     auto bytes = ::read(sockfd, &signal, sizeof(signal));
     Q_UNUSED(bytes)
-    quInfo() << "Caught signal" << signal;
+    qInfo() << "Caught signal" << signal;
 
     switch (signal) {
     case SIGHUP: