fix build warning and coding rule error 71/152071/2 accepted/tizen/unified/20170926.165801 submit/tizen/20170926.073310
authorYoungjae Shin <yj99.shin@samsung.com>
Mon, 25 Sep 2017 04:37:50 +0000 (13:37 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Mon, 25 Sep 2017 04:47:57 +0000 (13:47 +0900)
Change-Id: If2745e44e6cb8843b825eb1c25fa7ac9dfe489d6

src/factory-reset.c

index b3aaefb557b9b576c26d3f181037ce07e3d07056..6e06ab643e512dd542e26966b29e71d41e571eca 100644 (file)
@@ -120,12 +120,12 @@ static GMainLoop* loop;
 static DBusConnection *bus_conn = NULL;
 static const char *dbus_obj_path = "/org/tizen/factoryreset";
 
-static void unregistered_func (DBusConnection *connection, void *user_data)
+static void unregistered_func(DBusConnection *connection, void *user_data)
 {
        perror("factory-reset dbus unregistered\n");
 }
 
-static DBusHandlerResult message_func (DBusConnection *connection,
+static DBusHandlerResult message_func(DBusConnection *connection,
                DBusMessage    *message,
                void           *user_data)
 {
@@ -142,7 +142,7 @@ static DBusHandlerResult message_func (DBusConnection *connection,
        if (strncmp(dbus_message_get_interface(message), RESET_DBUS_INTERFACE,
                                strlen(RESET_DBUS_INTERFACE)) != 0) {
                printf("Not correct interface: \"%s\"\n",
-                               dbus_message_get_interface (message));
+                               dbus_message_get_interface(message));
                return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
        }
 
@@ -187,10 +187,10 @@ static DBusHandlerResult message_func (DBusConnection *connection,
 }
 
 
-static DBusHandlerResult filter_func (DBusConnection  *connection,
+static DBusHandlerResult filter_func(DBusConnection  *connection,
                DBusMessage *message, void *user_data)
 {
-       if (dbus_message_is_signal (message, DBUS_INTERFACE_LOCAL,
+       if (dbus_message_is_signal(message, DBUS_INTERFACE_LOCAL,
                                "Disconnected")) {
                /* Exit cleanly. */
                printf("Disconnected");
@@ -209,9 +209,9 @@ static int process_dbus(void)
        int ret;
        DBusError error;
 
-       loop = g_main_loop_new (NULL, FALSE);
+       loop = g_main_loop_new(NULL, FALSE);
 
-       dbus_error_init (&error);
+       dbus_error_init(&error);
        bus_conn = dbus_bus_get(DBUS_BUS_SYSTEM, &error);
        if (!bus_conn) {
                perror("failed to get dbus system bus");
@@ -226,7 +226,7 @@ static int process_dbus(void)
 
        /* Should be ret == -1, if error is set */
        if (ret == -1 && dbus_error_is_set(&error)) {
-               dbus_error_free (&error);
+               dbus_error_free(&error);
                return -1;
        }
 
@@ -244,7 +244,7 @@ static int process_dbus(void)
 int main(int argc, char **argv)
 {
        FILE *fp;
-       int ret, i = 0, c;
+       int i = 0, c;
        const char *reset_cmd[] = {RUN_SCRIPT_FILE, NULL, NULL};
        time_t t = time(NULL);
        struct tm tm2 = *localtime(&t);
@@ -255,7 +255,7 @@ int main(int argc, char **argv)
        };
 
 #if 0
-       ret = setuid(0);
+       int ret = setuid(0);
        if (ret < 0) {
                perror("wrong permission");
                return -1;