summaryrefslogtreecommitdiff
path: root/src/bin/efreet
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-12-28 10:22:23 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-12-28 10:22:23 +0900
commit0aa4de9f1d31452e568f561cd543ad5bc929b24e (patch)
tree593abffb7a981a1c9b09a6c72daa48fe994d6c5c /src/bin/efreet
parent4270ddb0b74970afe5b5e05234d8ebe7ecd5f7b0 (diff)
efreet - minor formatting and move set prirority to very start
Diffstat (limited to 'src/bin/efreet')
-rw-r--r--src/bin/efreet/efreetd.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/bin/efreet/efreetd.c b/src/bin/efreet/efreetd.c
index 2a61affab6..1661ec293b 100644
--- a/src/bin/efreet/efreetd.c
+++ b/src/bin/efreet/efreetd.c
@@ -31,8 +31,14 @@ main(int argc, char *argv[])
31 int fd; 31 int fd;
32 mode_t um; 32 mode_t um;
33 33
34#ifdef HAVE_SYS_RESOURCE_H
35 setpriority(PRIO_PROCESS, 0, 19);
36#elif _WIN32
37 SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS);
38#endif
39
34 strcpy(path, "/tmp/efreetd_XXXXXX"); 40 strcpy(path, "/tmp/efreetd_XXXXXX");
35 um = umask(S_IRWXG|S_IRWXO); 41 um = umask(S_IRWXG | S_IRWXO);
36 fd = mkstemp(path); 42 fd = mkstemp(path);
37 umask(um); 43 umask(um);
38 if (fd < 0) 44 if (fd < 0)
@@ -40,32 +46,24 @@ main(int argc, char *argv[])
40 perror("mkstemp"); 46 perror("mkstemp");
41 return 1; 47 return 1;
42 } 48 }
43
44 log = fdopen(fd, "wb"); 49 log = fdopen(fd, "wb");
45 if (!log) return 1; 50 if (!log) return 1;
46 51
47 if (!eina_init()) return 1; 52 if (!eina_init()) return 1;
48 eina_log_print_cb_set(eina_log_print_cb_file, log); 53 eina_log_print_cb_set(eina_log_print_cb_file, log);
49
50 efreetd_log_dom = eina_log_domain_register("efreetd", EFREETD_DEFAULT_LOG_COLOR); 54 efreetd_log_dom = eina_log_domain_register("efreetd", EFREETD_DEFAULT_LOG_COLOR);
51 if (efreetd_log_dom < 0) 55 if (efreetd_log_dom < 0)
52 { 56 {
53 EINA_LOG_ERR("Efreet: Could not create a log domain for efreetd."); 57 EINA_LOG_ERR("Efreet: Could not create a log domain for efreetd.");
54 goto ecore_error; 58 goto ecore_error;
55 } 59 }
60
56 if (!ecore_init()) goto ecore_error; 61 if (!ecore_init()) goto ecore_error;
57 ecore_app_args_set(argc, (const char **)argv); 62 ecore_app_args_set(argc, (const char **)argv);
58 if (!ecore_file_init()) goto ecore_file_error; 63 if (!ecore_file_init()) goto ecore_file_error;
59
60 if (!dbus_init()) goto dbus_error; 64 if (!dbus_init()) goto dbus_error;
61 if (!cache_init()) goto cache_error; 65 if (!cache_init()) goto cache_error;
62 66
63#ifdef HAVE_SYS_RESOURCE_H
64 setpriority(PRIO_PROCESS, 0, 19);
65#elif _WIN32
66 SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS);
67#endif
68
69 ecore_main_loop_begin(); 67 ecore_main_loop_begin();
70 68
71 cache_shutdown(); 69 cache_shutdown();
@@ -84,8 +82,7 @@ dbus_error:
84ecore_file_error: 82ecore_file_error:
85 ecore_shutdown(); 83 ecore_shutdown();
86ecore_error: 84ecore_error:
87 if (efreetd_log_dom >= 0) 85 if (efreetd_log_dom >= 0) eina_log_domain_unregister(efreetd_log_dom);
88 eina_log_domain_unregister(efreetd_log_dom);
89 efreetd_log_dom = -1; 86 efreetd_log_dom = -1;
90 eina_shutdown(); 87 eina_shutdown();
91 return 1; 88 return 1;