diff options
-rw-r--r-- | serial/Makefile.am | 11 | ||||
-rw-r--r-- | serial/main.c | 60 |
2 files changed, 71 insertions, 0 deletions
diff --git a/serial/Makefile.am b/serial/Makefile.am index 02742923..7cb86842 100644 --- a/serial/Makefile.am +++ b/serial/Makefile.am @@ -1,2 +1,13 @@ +noinst_PROGRAMS = bluetoothd-service-serial + +bluetoothd_service_serial_SOURCES = main.c + +LDADD = $(top_builddir)/common/libhelper.a \ + @GLIB_LIBS@ @DBUS_LIBS@ @BLUEZ_LIBS@ + +AM_CFLAGS = @BLUEZ_CFLAGS@ @DBUS_CFLAGS@ @GLIB_CFLAGS@ + +INCLUDES = -I$(top_srcdir)/common + MAINTAINERCLEANFILES = Makefile.in 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 <marcel@holtmann.org> + * + * + * 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 <config.h> +#endif + +#include <string.h> +#include <signal.h> + +#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; +} |