From e6fe40e5e92a6942869a2fc7e7cb210d18da3929 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 26 Feb 2007 00:15:27 +0000 Subject: Add skeleton for serial port service --- serial/main.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 serial/main.c (limited to 'serial/main.c') diff --git a/serial/main.c b/serial/main.c new file mode 100644 index 00000000..b6f52d46 --- /dev/null +++ b/serial/main.c @@ -0,0 +1,60 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2004-2007 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include "logging.h" + +static void sig_term(int sig) +{ +} + +int main(int argc, char *argv[]) +{ + struct sigaction sa; + + start_logging("serial", "Bluetooth Serial Port daemon"); + + memset(&sa, 0, sizeof(sa)); + sa.sa_flags = SA_NOCLDSTOP; + sa.sa_handler = sig_term; + sigaction(SIGTERM, &sa, NULL); + sigaction(SIGINT, &sa, NULL); + + sa.sa_handler = SIG_IGN; + sigaction(SIGCHLD, &sa, NULL); + sigaction(SIGPIPE, &sa, NULL); + + enable_debug(); + + info("Exit"); + + stop_logging(); + + return 0; +} -- cgit