diff options
author | Vincent Torri <vincent.torri@gmail.com> | 2009-10-10 05:28:43 +0000 |
---|---|---|
committer | Vincent Torri <vincent.torri@gmail.com> | 2009-10-10 05:28:43 +0000 |
commit | 4072d0b23d3c3803932c6f82ec89555b52e3b8a2 (patch) | |
tree | ee18a18b8d3d63083a276c94f0387ff5d5636185 /legacy/ecore/src/lib/ecore_file/ecore_file.c | |
parent | 1d869a9ab18b75ac4c6da60f99841f212ba43eaf (diff) |
* check the returned value of the _init() functions
* simplify a bit the init/shutdown functions
SVN revision: 42995
Diffstat (limited to '')
-rw-r--r-- | legacy/ecore/src/lib/ecore_file/ecore_file.c | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/legacy/ecore/src/lib/ecore_file/ecore_file.c b/legacy/ecore/src/lib/ecore_file/ecore_file.c index 31a8e888c1..064016ae80 100644 --- a/legacy/ecore/src/lib/ecore_file/ecore_file.c +++ b/legacy/ecore/src/lib/ecore_file/ecore_file.c | |||
@@ -27,7 +27,7 @@ | |||
27 | #include "ecore_file_private.h" | 27 | #include "ecore_file_private.h" |
28 | 28 | ||
29 | 29 | ||
30 | static int init = 0; | 30 | static int _ecore_file_init_count = 0; |
31 | 31 | ||
32 | /* externally accessible functions */ | 32 | /* externally accessible functions */ |
33 | /** | 33 | /** |
@@ -39,29 +39,33 @@ static int init = 0; | |||
39 | EAPI int | 39 | EAPI int |
40 | ecore_file_init() | 40 | ecore_file_init() |
41 | { | 41 | { |
42 | if (++init != 1) return init; | 42 | if (++_ecore_file_init_count != 1) |
43 | 43 | return _ecore_file_init_count; | |
44 | // if (! | ||
45 | ecore_file_monitor_init(); | ||
46 | // ) | ||
47 | // goto error; | ||
48 | // if (! | ||
49 | ecore_file_path_init(); | ||
50 | // ) | ||
51 | // goto error; | ||
52 | // if (! | ||
53 | ecore_file_download_init(); | ||
54 | // ) | ||
55 | // goto error; | ||
56 | return init; | ||
57 | |||
58 | //error: | ||
59 | 44 | ||
45 | ecore_file_path_init(); | ||
46 | ecore_file_monitor_init(); | ||
47 | ecore_file_download_init(); | ||
48 | |||
49 | /* FIXME: were the tests disabled for a good reason ? */ | ||
50 | |||
51 | /* | ||
52 | if (!ecore_file_monitor_init()) | ||
53 | goto shutdown_ecore_file_path; | ||
54 | |||
55 | if (!ecore_file_download_init()) | ||
56 | goto shutdown_ecore_file_monitor; | ||
57 | */ | ||
58 | |||
59 | return _ecore_file_init_count; | ||
60 | |||
61 | /* | ||
62 | shutdown_ecore_file_monitor: | ||
60 | ecore_file_monitor_shutdown(); | 63 | ecore_file_monitor_shutdown(); |
64 | shutdown_ecore_file_path: | ||
61 | ecore_file_path_shutdown(); | 65 | ecore_file_path_shutdown(); |
62 | ecore_file_download_shutdown(); | ||
63 | 66 | ||
64 | return --init; | 67 | return --_ecore_file_init_count; |
68 | */ | ||
65 | } | 69 | } |
66 | 70 | ||
67 | /** | 71 | /** |
@@ -71,13 +75,14 @@ ecore_file_init() | |||
71 | EAPI int | 75 | EAPI int |
72 | ecore_file_shutdown() | 76 | ecore_file_shutdown() |
73 | { | 77 | { |
74 | if (--init != 0) return init; | 78 | if (--_ecore_file_init_count != 0) |
79 | return _ecore_file_init_count; | ||
75 | 80 | ||
81 | ecore_file_download_shutdown(); | ||
76 | ecore_file_monitor_shutdown(); | 82 | ecore_file_monitor_shutdown(); |
77 | ecore_file_path_shutdown(); | 83 | ecore_file_path_shutdown(); |
78 | ecore_file_download_shutdown(); | ||
79 | 84 | ||
80 | return init; | 85 | return _ecore_file_init_count; |
81 | } | 86 | } |
82 | 87 | ||
83 | /** | 88 | /** |