From b6ce3afdb57bb8364c27d5e8aff6da444ea86ede Mon Sep 17 00:00:00 2001 From: sebastid Date: Wed, 7 Sep 2005 08:57:08 +0000 Subject: [PATCH] Only run init when count is 1 and shutdown when count is 0 SVN revision: 16649 --- legacy/ecore/src/lib/ecore_file/ecore_file.c | 4 ++-- legacy/ecore/src/lib/ecore_file/ecore_file_download.c | 4 ++-- legacy/ecore/src/lib/ecore_file/ecore_file_monitor.c | 4 ++-- legacy/ecore/src/lib/ecore_file/ecore_file_path.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/legacy/ecore/src/lib/ecore_file/ecore_file.c b/legacy/ecore/src/lib/ecore_file/ecore_file.c index 60c1a213cc..840bc1011c 100644 --- a/legacy/ecore/src/lib/ecore_file/ecore_file.c +++ b/legacy/ecore/src/lib/ecore_file/ecore_file.c @@ -9,7 +9,7 @@ static int init = 0; int ecore_file_init() { - if (++init > 1) return init; + if (++init != 1) return init; if (!ecore_file_monitor_init()) goto error; @@ -31,7 +31,7 @@ error: int ecore_file_shutdown() { - if (--init > 0) return init; + if (--init != 0) return init; ecore_file_monitor_shutdown(); ecore_file_path_shutdown(); diff --git a/legacy/ecore/src/lib/ecore_file/ecore_file_download.c b/legacy/ecore/src/lib/ecore_file/ecore_file_download.c index c9fc4fb12a..75bc5f34ec 100644 --- a/legacy/ecore/src/lib/ecore_file/ecore_file_download.c +++ b/legacy/ecore/src/lib/ecore_file/ecore_file_download.c @@ -33,7 +33,7 @@ static fd_set _current_fd_set; int ecore_file_download_init(void) { - if (++init > 1) return init; + if (++init != 1) return init; #ifdef HAVE_CURL FD_ZERO(&_current_fd_set); @@ -56,7 +56,7 @@ ecore_file_download_init(void) int ecore_file_download_shutdown(void) { - if (--init > 0) return init; + if (--init != 0) return init; #ifdef HAVE_CURL Ecore_File_Download_Job *job; diff --git a/legacy/ecore/src/lib/ecore_file/ecore_file_monitor.c b/legacy/ecore/src/lib/ecore_file/ecore_file_monitor.c index 77b63621e8..7b7a57e6c7 100644 --- a/legacy/ecore/src/lib/ecore_file/ecore_file_monitor.c +++ b/legacy/ecore/src/lib/ecore_file/ecore_file_monitor.c @@ -23,7 +23,7 @@ static Ecore_File_Monitor_Type monitor_type = ECORE_FILE_MONITOR_TYPE_NONE; int ecore_file_monitor_init(void) { - if (++init > 1) return init; + if (++init != 1) return init; #ifdef HAVE_INOTIFY monitor_type = ECORE_FILE_MONITOR_TYPE_INOTIFY; @@ -49,7 +49,7 @@ ecore_file_monitor_init(void) int ecore_file_monitor_shutdown(void) { - if (--init > 0) return init; + if (--init != 0) return init; switch (monitor_type) { diff --git a/legacy/ecore/src/lib/ecore_file/ecore_file_path.c b/legacy/ecore/src/lib/ecore_file/ecore_file_path.c index ee30712488..a641b477bb 100644 --- a/legacy/ecore/src/lib/ecore_file/ecore_file_path.c +++ b/legacy/ecore/src/lib/ecore_file/ecore_file_path.c @@ -11,7 +11,7 @@ static Ecore_List *_ecore_file_path_from_env(const char *env); int ecore_file_path_init(void) { - if (++init > 1) return init; + if (++init != 1) return init; __ecore_file_path_bin = _ecore_file_path_from_env("PATH"); return init; } @@ -19,7 +19,7 @@ ecore_file_path_init(void) int ecore_file_path_shutdown(void) { - if (--init > 0) return init; + if (--init != 0) return init; ecore_list_destroy(__ecore_file_path_bin); return init; }