From e303f3988a9fbbe5353213616752e1fe7386ed98 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Mon, 11 Apr 2016 08:12:13 +0900 Subject: [PATCH] Adjust coding rules Change-Id: I1e4651183f93268eb484d648cff240faa7ed7c22 Signed-off-by: Hwankyu Jhun --- include/common.h | 6 ++---- include/debug_util.h | 3 ++- include/defs.h | 2 +- include/file_util.h | 3 ++- include/perf.h | 9 ++++++--- include/security_util.h | 3 ++- include/signal_util.h | 3 ++- src/common.c | 24 ++++++++++++++++-------- src/debug-launchpad.c | 17 +++++++++++------ src/debug_util.c | 10 ++++++---- src/file_util.c | 6 ++++-- src/security_util.c | 3 ++- src/signal_util.c | 29 +++++++++++++++-------------- 13 files changed, 71 insertions(+), 47 deletions(-) diff --git a/include/common.h b/include/common.h index fa7e9b4..b63e6c6 100644 --- a/include/common.h +++ b/include/common.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -62,14 +62,12 @@ struct ucred; int _create_server_sock(void); app_pkt_t *_recv_pkt_raw(int fd, int *clifd, struct ucred *cr); - appinfo_t *_appinfo_create(bundle *kb); void _appinfo_free(appinfo_t *appinfo); void _modify_bundle(bundle *kb, int caller_pid, appinfo_t *appinfo, int cmd); - void _set_env(appinfo_t *app_info, bundle *kb); char **_create_argc_argv(bundle *kb, int *margc, const char *app_path); - int _proc_check_cmdline_bypid(int pid); #endif /* __COMMON_H__ */ + diff --git a/include/debug_util.h b/include/debug_util.h index 4168c95..b86e07d 100644 --- a/include/debug_util.h +++ b/include/debug_util.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,3 +32,4 @@ void _set_env(appinfo_t *app_info, bundle *kb); char **_create_argc_argv(bundle *kb, int *margc, const char *app_path); #endif /* __DEBUG_UTIL_H__ */ + diff --git a/include/defs.h b/include/defs.h index 9af5393..8a5cff4 100644 --- a/include/defs.h +++ b/include/defs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/file_util.h b/include/file_util.h index dbc158e..1039401 100644 --- a/include/file_util.h +++ b/include/file_util.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,3 +22,4 @@ int dlp_chmod(const char *path, mode_t mode, int recursive); #endif /* __FILE_UTIL_H__ */ + diff --git a/include/perf.h b/include/perf.h index cfa9f59..ec66620 100755 --- a/include/perf.h +++ b/include/perf.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,9 +46,11 @@ static struct timeval __g_base_time = { gettimeofday(&cur, NULL); \ if (__g_base_time.tv_sec != 0) { \ timersub(&cur, &__g_base_time, &res); \ - printf("%c[1;31m[%s,%d] %ld sec %ld msec "fmt" %c[0m\n", \ + printf("%c[1;31m[%s,%d] %ld sec %ld msec " \ + fmt" %c[0m\n", \ 27, __FUNCTION__, __LINE__, \ - res.tv_sec, res.tv_usec/1000, ##arg, 27); \ + res.tv_sec, res.tv_usec/1000, \ + ##arg, 27); \ } \ } while (0) #else @@ -57,3 +59,4 @@ static struct timeval __g_base_time = { #endif #endif /* __PERF_H__ */ + diff --git a/include/security_util.h b/include/security_util.h index 61c2a56..6029c59 100644 --- a/include/security_util.h +++ b/include/security_util.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,3 +23,4 @@ int _apply_smack_rules(const char *subject, const char *object, int _set_access(const char *appid); #endif /* __SECURITY_UTIL_H__ */ + diff --git a/include/signal_util.h b/include/signal_util.h index df0bae1..2dd74fb 100644 --- a/include/signal_util.h +++ b/include/signal_util.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,3 +28,4 @@ int _signal_unblock_sigchld(void); int _signal_fini(void); #endif /* __SIGNAL_UTIL_H__ */ + diff --git a/src/common.c b/src/common.c index 4b05749..7ff591a 100644 --- a/src/common.c +++ b/src/common.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -431,7 +431,8 @@ void _modify_bundle(bundle *kb, int caller_pid, appinfo_t *appinfo, int cmd) break; ptr += flag; - flag = __parse_app_path(ptr, value, sizeof(value)); + flag = __parse_app_path(ptr, value, + sizeof(value)); if (flag < 0) break; ptr += flag; @@ -625,7 +626,8 @@ char **_create_argc_argv(bundle *kb, int *margc, const char *app_path) if (str_array[i] == NULL) break; - if (strncmp(str_array[i], SDK_DEBUG, strlen(str_array[i])) == 0) { + if (strncmp(str_array[i], SDK_DEBUG, + strlen(str_array[i])) == 0) { if (argv[0]) free(argv[0]); snprintf(buf, sizeof(buf), "%s.exe", app_path); @@ -648,7 +650,8 @@ char **_create_argc_argv(bundle *kb, int *margc, const char *app_path) new_argv = __add_arg(kb, argv, &argc, DLP_K_DEBUG_ARG); new_argv[0] = strdup(path); argv = new_argv; - } else if (strncmp(str_array[i], SDK_VALGRIND, strlen(str_array[i])) == 0) { + } else if (strncmp(str_array[i], SDK_VALGRIND, + strlen(str_array[i])) == 0) { path = bundle_get_val(kb, DLP_K_VALGRIND_PATH); if (path == NULL) { _E("Failed to get valgrind path"); @@ -658,13 +661,17 @@ char **_create_argc_argv(bundle *kb, int *margc, const char *app_path) *margc = 0; return NULL; } - new_argv = __add_arg(kb, argv, &argc, DLP_K_VALGRIND_ARG); + new_argv = __add_arg(kb, argv, &argc, + DLP_K_VALGRIND_ARG); new_argv[0] = strdup(path); argv = new_argv; - } else if (strncmp(str_array[i], SDK_UNIT_TEST, strlen(str_array[i])) == 0) { - new_argv = __add_arg(kb, argv, &argc, DLP_K_UNIT_TEST_ARG); + } else if (strncmp(str_array[i], SDK_UNIT_TEST, + strlen(str_array[i])) == 0) { + new_argv = __add_arg(kb, argv, &argc, + DLP_K_UNIT_TEST_ARG); argv = new_argv; - } else if (strncmp(str_array[i], SDK_ATTACH, strlen(str_array[i])) == 0) { + } else if (strncmp(str_array[i], SDK_ATTACH, + strlen(str_array[i])) == 0) { path = bundle_get_val(kb, DLP_K_GDBSERVER_PATH); if (path == NULL) { _E("Failed to get gdbserver path"); @@ -725,3 +732,4 @@ int _proc_check_cmdline_bypid(int pid) return 0; } + diff --git a/src/debug-launchpad.c b/src/debug-launchpad.c index 6aea995..bbe7b60 100644 --- a/src/debug-launchpad.c +++ b/src/debug-launchpad.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -78,7 +78,8 @@ static void __send_result_to_caller(int clifd, int ret) res = _proc_check_cmdline_bypid(ret); if (res < 0) { - _E("The app process might be terminated while we are wating %d", ret); + _E("The app process might be terminated " + "while we are wating %d", ret); __real_send(clifd, -1); /* abnormally launched */ return; } @@ -106,7 +107,8 @@ static int __prepare_exec(const char *appid, const char *app_path, _D("appid: %s / pkg_type: %s / app_path: %s", appid, appinfo->pkg_type, app_path); if ((ret = _set_access(appid)) != 0) { - _E("Failed to set privileges - check your package's credential: %d", ret); + _E("Failed to set privileges " + "- check your package's credential: %d", ret); return -1; } @@ -279,7 +281,8 @@ static int __start_process(const char *appid, const char *app_path, _D("lock up test log(no error): prepare exec - first done"); if (__prepare_exec(appid, app_path, appinfo, kb) < 0) { - _E("preparing work fail to launch - can not launch %s", appid); + _E("preparing work fail to launch " + "- can not launch %s", appid); exit(-1); } @@ -402,7 +405,8 @@ static gboolean __glib_check(GSource *src) fd_list = src->poll_fds; do { tmp = (GPollFD *)fd_list->data; - if ((tmp->revents & (G_IO_IN | G_IO_PRI | G_IO_HUP | G_IO_NVAL))) + if ((tmp->revents & + (G_IO_IN | G_IO_PRI | G_IO_HUP | G_IO_NVAL))) return TRUE; fd_list = fd_list->next; } while (fd_list); @@ -410,7 +414,8 @@ static gboolean __glib_check(GSource *src) return FALSE; } -static gboolean __glib_dispatch(GSource *src, GSourceFunc callback, gpointer data) +static gboolean __glib_dispatch(GSource *src, GSourceFunc callback, + gpointer data) { return callback(data); } diff --git a/src/debug_util.c b/src/debug_util.c index ab18d35..cc27f12 100644 --- a/src/debug_util.c +++ b/src/debug_util.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -195,11 +195,13 @@ int _prepare_debug_tool(bundle *kb, const char *appid, if (str_arr[i] == NULL) break; - if (strncmp(str_arr[i], SDK_DEBUG, strlen(SDK_DEBUG)) == 0 - || strncmp(str_arr[i], SDK_ATTACH, strlen(SDK_ATTACH)) == 0) { + if (strncmp(str_arr[i], SDK_DEBUG, strlen(SDK_DEBUG)) == 0 || + strncmp(str_arr[i], SDK_ATTACH, + strlen(SDK_ATTACH)) == 0) { if (__prepare_gdbserver(kb, appid) < 0) return -1; - } else if (strncmp(str_arr[i], SDK_VALGRIND, strlen(SDK_VALGRIND)) == 0) { + } else if (strncmp(str_arr[i], SDK_VALGRIND, + strlen(SDK_VALGRIND)) == 0) { __prepare_valgrind(kb); } } diff --git a/src/file_util.c b/src/file_util.c index eb4cce9..d7f2bea 100644 --- a/src/file_util.c +++ b/src/file_util.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,7 +56,8 @@ int dlp_chmod(const char *path, mode_t mode, int recursive) struct stat lstat_info; struct stat fstat_info; #ifdef HAVE_WIN32_PROC - fprintf(stderr, "error: dlp_chmod not implemented on Win32 (%s)\n", path); + fprintf(stderr, "error: dlp_chmod not implemented on Win32 (%s)\n", + path); return -1; #else @@ -91,3 +92,4 @@ int dlp_chmod(const char *path, mode_t mode, int recursive) return 0; #endif } + diff --git a/src/security_util.c b/src/security_util.c index 3269a9f..0bc891c 100644 --- a/src/security_util.c +++ b/src/security_util.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,3 +64,4 @@ int _set_access(const char *appid) { return security_manager_prepare_app(appid); } + diff --git a/src/signal_util.c b/src/signal_util.c index ee9744e..d761a79 100644 --- a/src/signal_util.c +++ b/src/signal_util.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -73,12 +73,12 @@ int _send_app_dead_signal(int dead_pid) return -1; if (g_dbus_connection_emit_signal(bus, - NULL, - AUL_DBUS_PATH, - AUL_DBUS_SIGNAL_INTERFACE, - AUL_DBUS_APPDEAD_SIGNAL, - g_variant_new("(u)", dead_pid), - &err) == FALSE) { + NULL, + AUL_DBUS_PATH, + AUL_DBUS_SIGNAL_INTERFACE, + AUL_DBUS_APPDEAD_SIGNAL, + g_variant_new("(u)", dead_pid), + &err) == FALSE) { _E("g_dbus_connection_emit_signal() is failed: %s", err->message); g_error_free(err); @@ -105,14 +105,14 @@ int _send_app_launch_signal(int launch_pid, const char *app_id) return -1; if (g_dbus_connection_emit_signal(bus, - NULL, - AUL_DBUS_PATH, - AUL_DBUS_SIGNAL_INTERFACE, - AUL_DBUS_APPLAUNCH_SIGNAL, - g_variant_new("(us)", launch_pid, app_id), - &err) == FALSE) { + NULL, + AUL_DBUS_PATH, + AUL_DBUS_SIGNAL_INTERFACE, + AUL_DBUS_APPLAUNCH_SIGNAL, + g_variant_new("(us)", launch_pid, app_id), + &err) == FALSE) { _E("g_dbus_connection_emit_signal() is failed: %s", - err->message); + err->message); g_error_free(err); return -1; } @@ -248,3 +248,4 @@ int _signal_fini(void) #endif return 0; } + -- 2.7.4