summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMyoungJune Park <mj2004.park@samsung.com>2017-09-26 07:57:22 (GMT)
committerMyoungJune Park <mj2004.park@samsung.com>2017-09-27 02:04:08 (GMT)
commitff07c4f457dc02035ff6c1385ef4004d64622d86 (patch)
treedbff98f72808b83b88364a6176913b75b0a6f2b5
parent7a2bb96c4b99c5e51fc294dedf192db316c28bc1 (diff)
downloadfactory-reset-ff07c4f457dc02035ff6c1385ef4004d64622d86.zip
factory-reset-ff07c4f457dc02035ff6c1385ef4004d64622d86.tar.gz
factory-reset-ff07c4f457dc02035ff6c1385ef4004d64622d86.tar.bz2
Change-Id: I955f2074f63dc8c4979dde8267c451325c3e7228 Signed-off-by: MyoungJune Park <mj2004.park@samsung.com>
-rwxr-xr-xsrc/factory-reset-util.c29
-rw-r--r--src/factory-reset-util.h9
-rw-r--r--src/factory-reset.c11
3 files changed, 30 insertions, 19 deletions
diff --git a/src/factory-reset-util.c b/src/factory-reset-util.c
index 508ebe2..7564366 100755
--- a/src/factory-reset-util.c
+++ b/src/factory-reset-util.c
@@ -128,7 +128,7 @@ static Evas_Object* _create_progressbar(Evas_Object* parent)
evas_object_size_hint_align_set(progressbar, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(progressbar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_progressbar_pulse(progressbar, EINA_TRUE);
- elm_object_part_content_set(layout,"pending_pbar", progressbar);
+ elm_object_part_content_set(layout, "pending_pbar", progressbar);
evas_object_show(progressbar);
return layout;
@@ -316,8 +316,15 @@ static int cp_resetcfg(int reset_config)
return ret;
}
#else /* TELEPHONY_DISABLE */
-static int cp_shutdown(void) { return -1;} /* in order to avoid main loop */
-static int cp_resetcfg(int reset_config) { return 0;}
+static int cp_shutdown(void)
+{
+ return -1;
+} /* in order to avoid main loop */
+
+static int cp_resetcfg(int reset_config)
+{
+ return 0;
+}
#endif /* TELEPHONY_DISABLE */
#endif
@@ -346,34 +353,34 @@ int main(int argc, char *argv[])
opt = getopt_long(argc, argv, "", options, &index);
- if(opt == -1)
+ if (opt == -1)
return 0;
- switch(index) {
- case 0 :
+ switch (index) {
+ case 0:
memset(&ad, 0x0, sizeof(struct appdata));
ops.data = &ad;
return appcore_efl_main(PACKAGE, &argc, &argv, &ops);
- case 1 :
+ case 1:
ecore_init();
//cp_resetcfg(TAPI_CFG_DEFAULT_SERVICE);
//if ( cp_shutdown() == 0) ecore_main_loop_begin();
ecore_shutdown();
break;
- case 2 :
+ case 2:
ecore_init();
//cp_resetcfg(TAPI_CFG_DEFAULT_FACTORY);
//if ( cp_shutdown() == 0) ecore_main_loop_begin();
ecore_shutdown();
break;
break;
- case 3 :
+ case 3:
break;
- case 4 :
+ case 4:
break;
- default :
+ default:
;
}
diff --git a/src/factory-reset-util.h b/src/factory-reset-util.h
index 3f60557..7a19628 100644
--- a/src/factory-reset-util.h
+++ b/src/factory-reset-util.h
@@ -36,12 +36,11 @@
#define EDJ_FILE "/usr/share/edje/factory-reset-util.edj"
#define GRP_MAIN "main"
-struct appdata
-{
- Evas_Object *win;
- Evas_Object *ly_main;
+struct appdata {
+ Evas_Object *win;
+ Evas_Object *ly_main;
- /* add more variables here */
+ /* add more variables here */
};
#ifdef DEBUG
diff --git a/src/factory-reset.c b/src/factory-reset.c
index 6e06ab6..0828b85 100644
--- a/src/factory-reset.c
+++ b/src/factory-reset.c
@@ -247,7 +247,12 @@ int main(int argc, char **argv)
int i = 0, c;
const char *reset_cmd[] = {RUN_SCRIPT_FILE, NULL, NULL};
time_t t = time(NULL);
- struct tm tm2 = *localtime(&t);
+
+ struct tm lt;
+ if (localtime_r(&t, &lt) == NULL) {
+ perror("localtime_r() error");
+ return -1;
+ }
static struct option long_options[] = {
{"dbus", no_argument, NULL, 'b'},
@@ -322,8 +327,8 @@ int main(int argc, char **argv)
// write finish log file
fprintf(fp, "End Factory Reset\n%d-%02d-%02d %02d:%02d:%02d\n",
- tm2.tm_year + 1900, tm2.tm_mon + 1, tm2.tm_mday,
- tm2.tm_hour, tm2.tm_min, tm2.tm_sec);
+ lt.tm_year + 1900, lt.tm_mon + 1, lt.tm_mday,
+ lt.tm_hour, lt.tm_min, lt.tm_sec);
fclose(fp);
// remove reset flag file, sync and reboot