signon
8.58
|
00001 /* 00002 * This file is part of signon 00003 * 00004 * Copyright (C) 2009-2010 Nokia Corporation. 00005 * 00006 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> 00007 * 00008 * This library is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU Lesser General Public License 00010 * version 2.1 as published by the Free Software Foundation. 00011 * 00012 * This library is distributed in the hope that it will be useful, but 00013 * WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with this library; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 00020 * 02110-1301 USA 00021 */ 00022 00023 #include "signondaemon.h" 00024 00025 #include <QtCore> 00026 00027 using namespace SignonDaemonNS; 00028 00029 void installSigHandlers() 00030 { 00031 struct sigaction act; 00032 act.sa_handler = SignonDaemon::signalHandler; 00033 sigemptyset(&act.sa_mask); 00034 act.sa_flags = SA_RESTART; 00035 00036 sigaction(SIGHUP, &act, 0); 00037 sigaction(SIGTERM, &act, 0); 00038 sigaction(SIGINT, &act, 0); 00039 } 00040 00041 int main(int argc, char *argv[]) 00042 { 00043 QCoreApplication app(argc, argv); 00044 installSigHandlers(); 00045 00046 QMetaObject::invokeMethod(SignonDaemon::instance(), 00047 "init", 00048 Qt::QueuedConnection); 00049 return app.exec(); 00050 }