From f601ff64a01482f10aea91db22245e739cfe8741 Mon Sep 17 00:00:00 2001 From: "Graydon, Tracy" Date: Wed, 6 Mar 2013 22:58:44 -0800 Subject: [PATCH 1/1] Bump version to fix build issue --- CMakeLists.txt | 6 ++- debian/copyright | 7 ++- packaging/telephony-daemon.changes | 3 ++ packaging/telephony-daemon.spec | 6 ++- resource/etc/rc.d/init.d/telephony-daemon | 2 +- src/main.c | 80 ++++++++++++++++++++++++++----- src/monitor.c | 9 +++- src/monitor.h | 20 ++++++++ telephony-daemon.manifest | 12 ++++- 9 files changed, 120 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0282613..d377582 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,8 +18,9 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Werror -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wdeclaration-after-statement -Wmissing-declarations -Wredundant-decls -Wcast-align") -ADD_DEFINITIONS("-DFEATURE_DLOG_DEBUG") -ADD_DEFINITIONS("-DTCORE_LOG_TAG=\"DAEMON\"") +ADD_DEFINITIONS("-DFEATURE_TLOG_DEBUG") +ADD_DEFINITIONS("-DTCORE_LOG_TAG=\"TELEPHONY_DAEMON\"") +ADD_DEFINITIONS("-DDAEMON_VERSION=\"${VERSION}\"") MESSAGE(${CMAKE_C_FLAGS}) MESSAGE(${pkgs_LDFLAGS}) @@ -45,3 +46,4 @@ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resource/etc/rc.d/rc3.d/S30telephony-d PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resource/etc/rc.d/rc5.d/S30telephony-daemon DESTINATION /etc/rc.d/rc5.d/ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE) +INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME telephony-daemon) diff --git a/debian/copyright b/debian/copyright index d5a0cca..efd61ff 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,7 +1,6 @@ Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. This program is free software; you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License version 2.1. - -The full text of the LGPL 2.1 can be found in -/usr/share/common-licenses. +it under the terms of the the Apache License, Version 2.0 (the "License"); +You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0. diff --git a/packaging/telephony-daemon.changes b/packaging/telephony-daemon.changes index 47ecfb2..a5f412e 100644 --- a/packaging/telephony-daemon.changes +++ b/packaging/telephony-daemon.changes @@ -1,3 +1,6 @@ +* Thu Mar 7 06:57:21 UTC 2013 - tracy.graydon@intel.com +- Bump to 1.1.12 (same version in Main) + *Wed Nov 7 22:21:39 UTC 2012 - tracy.graydon@intel.com - Add .changes file - This prokect was forked from Tizen:Devel:Main to fix manifests for IVI diff --git a/packaging/telephony-daemon.spec b/packaging/telephony-daemon.spec index 6b1b3e2..2497279 100644 --- a/packaging/telephony-daemon.spec +++ b/packaging/telephony-daemon.spec @@ -1,6 +1,6 @@ Name: telephony-daemon Summary: Telephony daemon -Version: 0.1.6 +Version: 0.1.12 Release: 1 Group: System/Telephony License: Apache @@ -16,13 +16,14 @@ Description: Telephony daemon %prep %setup -q -cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} %build +cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DVERSION=%{version} make %{?jobs:-j%jobs} %install %make_install +mkdir -p %{buildroot}/usr/share/license %files %manifest telephony-daemon.manifest @@ -31,3 +32,4 @@ make %{?jobs:-j%jobs} %{_initrddir}/telephony-daemon %{_sysconfdir}/rc.d/rc3.d/S30telephony-daemon %{_sysconfdir}/rc.d/rc5.d/S30telephony-daemon +/usr/share/license/telephony-daemon diff --git a/resource/etc/rc.d/init.d/telephony-daemon b/resource/etc/rc.d/init.d/telephony-daemon index f9a37d8..494891b 100755 --- a/resource/etc/rc.d/init.d/telephony-daemon +++ b/resource/etc/rc.d/init.d/telephony-daemon @@ -1,6 +1,6 @@ #!/bin/sh -dlogutil -b radio -v time -f /var/log/seq.radio.log -r 1000 -n 10 & +dlogutil -b radio -v time -f /var/log/seq.radio.log -r 4000 -n 3 & if [ ! -e /opt/etc/.hib_capturing ]; then /usr/bin/telephony-daemon & diff --git a/src/main.c b/src/main.c index f26894e..bb905f9 100644 --- a/src/main.c +++ b/src/main.c @@ -26,18 +26,40 @@ #include #include #include +#include +#include +#include #include #include +#include #include #include #include +#include +#include #include "monitor.h" +#ifndef DAEMON_VERSION +#define DAEMON_VERSION "unknown" +#endif + static Server *_server; +void tcore_log(enum tcore_log_type type, enum tcore_log_priority priority, const char *tag, const char *fmt, ...) +{ + va_list ap; + char buf[1024]; + + va_start(ap, fmt); + vsnprintf(buf, 1023, fmt, ap); + va_end(ap); + + __dlog_print(type, priority, tag, buf); +} + static gboolean load_plugins(Server *s, const char *path, int flag_test_load) { const gchar *file; @@ -45,16 +67,22 @@ static gboolean load_plugins(Server *s, const char *path, int flag_test_load) GDir *dir; void *handle; GSList *list; + struct stat stat_buf; + char file_date[27]; TcorePlugin *p; struct tcore_plugin_define_desc *desc; + if (!path || !s) + return FALSE; + dir = g_dir_open(path, 0, NULL); if (!dir) return FALSE; while ((file = g_dir_read_name(dir)) != NULL) { - if (g_str_has_prefix(file, "lib") == TRUE || g_str_has_suffix(file, ".so") == FALSE) + if (g_str_has_prefix(file, "lib") == TRUE + || g_str_has_suffix(file, ".so") == FALSE) continue; filename = g_build_filename(path, file, NULL); @@ -81,6 +109,21 @@ static gboolean load_plugins(Server *s, const char *path, int flag_test_load) continue; } + dbg("%s plugin", desc->name); + dbg(" - path = %s", filename); + dbg(" - version = %d", desc->version); + dbg(" - priority = %d", desc->priority); + + memset(&stat_buf, 0, sizeof(struct stat)); + if (stat(filename, &stat_buf) == 0) { + if (ctime_r(&stat_buf.st_mtime, file_date) != NULL) { + if (strlen(file_date) > 1) + file_date[strlen(file_date)-1] = '\0'; + + dbg(" - date = %s", file_date); + } + } + if (desc->load) { if (desc->load() == FALSE) { dbg("false return from load(). skip this plugin"); @@ -93,11 +136,13 @@ static gboolean load_plugins(Server *s, const char *path, int flag_test_load) p = tcore_plugin_new(s, desc, filename, handle); tcore_server_add_plugin(s, p); - dbg("plugin(%s) added", filename); + dbg("%s added", desc->name); g_free(filename); } g_dir_close(dir); + info("plugin load finished"); + list = tcore_server_ref_plugins(s); for (; list; list = list->next) { p = list->data; @@ -116,6 +161,8 @@ static gboolean load_plugins(Server *s, const char *path, int flag_test_load) } } + info("plugin init finished"); + return TRUE; } @@ -140,7 +187,7 @@ int main(int argc, char *argv[]) { struct sigaction sigact_usr1; Server *s; - int flag_test_load=0; + int flag_test_load = 0; int opt; int opt_index; struct option options[] = { @@ -149,6 +196,18 @@ int main(int argc, char *argv[]) { 0, 0, 0, 0 } }; char *plugin_path = "/usr/lib/telephony/plugins/"; + char *tcore_ver; + struct sysinfo info; + + if (sysinfo(&info) == 0) { + info("uptime: %ld secs", info.uptime); + } + + info("daemon version: %s", DAEMON_VERSION); + + tcore_ver = tcore_util_get_version(); + info("libtcore version: %s", tcore_ver); + free(tcore_ver); sigact_usr1.sa_handler = on_signal_usr1; sigemptyset(&sigact_usr1.sa_mask); @@ -159,7 +218,6 @@ int main(int argc, char *argv[]) warn("sigaction(SIGUSR1) failed."); } - while (1) { opt = getopt_long(argc, argv, "hT", options, &opt_index); @@ -187,12 +245,10 @@ int main(int argc, char *argv[]) } } - if (optind < argc) { + if (optind < argc) plugin_path = argv[optind]; - } - dbg("plugin_path: [%s]", plugin_path); - dbg("flag[test_load]: %d", flag_test_load); + info("plugin_path: [%s]", plugin_path); g_type_init(); #if !GLIB_CHECK_VERSION (2, 31, 0) @@ -206,16 +262,16 @@ int main(int argc, char *argv[]) } _server = s; - if (!load_plugins(s, plugin_path, flag_test_load)) { + if (!load_plugins(s, plugin_path, flag_test_load)) goto free_end; - } if (flag_test_load) goto free_end; + info("server mainloop start"); + if (tcore_server_run(s) == FALSE) { err("server_run failed."); - goto free_end; } /* @@ -223,7 +279,7 @@ int main(int argc, char *argv[]) */ free_end: - dbg("exit!"); + info("server end"); tcore_server_free(s); end: diff --git a/src/monitor.c b/src/monitor.c index 6453e15..9981143 100644 --- a/src/monitor.c +++ b/src/monitor.c @@ -37,6 +37,7 @@ #include #include #include +#include #include "monitor.h" @@ -81,7 +82,6 @@ static void _monitor_storage(Server *s) { GSList *list; Storage *strg; - char *str; msg("-- Storages --"); @@ -130,6 +130,7 @@ static void _monitor_hal(Server *s) TcoreHal *h; TcoreQueue *q; TcorePending *pending; + UserRequest *ur; char *str; int qlen; int i; @@ -169,7 +170,11 @@ static void _monitor_hal(Server *s) msg(" queue_head: %p", g_queue_peek_head(q->gq)); for (i = 0; i < qlen; i++) { pending = g_queue_peek_nth(q->gq, i); - msg(" [%02d] pending=%p, id=0x%x, ur=%p", i, pending, tcore_pending_get_id(pending), tcore_pending_ref_user_request(pending)); + ur = tcore_pending_ref_user_request(pending); + msg(" [%02d] pending=%p, id=0x%x, ur=%p", i, pending, tcore_pending_get_id(pending), ur); + if (ur) { + msg(" ur request command = 0x%x", tcore_user_request_get_command(ur)); + } data_len = 0; data = tcore_pending_ref_request_data(pending, &data_len); msg(" data=%p, data_len=%d", data, data_len); diff --git a/src/monitor.h b/src/monitor.h index 145deef..ac76bdf 100644 --- a/src/monitor.h +++ b/src/monitor.h @@ -1,3 +1,23 @@ +/* + * telephony-daemon + * + * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Ja-young Gu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + #ifndef __MONITIR_H__ #define __MONITOR_H__ diff --git a/telephony-daemon.manifest b/telephony-daemon.manifest index 20c9142..3ca0c6a 100644 --- a/telephony-daemon.manifest +++ b/telephony-daemon.manifest @@ -1,8 +1,16 @@ - + + + + + + + + - + -- 2.7.4