1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "sigtermhandler.h"
5
6#include <QTextStream>
7
8SigTermHandler *SigTermHandler::instance()
9{
10 static auto inst = new SigTermHandler();
11 return inst;
12}
13
14void SigTermHandler::handle(int s)
15{
16 QTextStream out(stdout);
17 out << " Caught signal " << s << Qt::endl;
18 emit instance()->sigTermSignal();
19}
20
21SigTermHandler::~SigTermHandler() { }
22
23SigTermHandler::SigTermHandler(QObject *parent) : QObject(parent) { }
24

source code of qtserialbus/src/tools/canbusutil/sigtermhandler.cpp