summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKichan Kwon <k_c.kwon@samsung.com>2017-09-18 19:01:57 +0900
committerKichan Kwon <k_c.kwon@samsung.com>2017-09-21 10:03:40 +0900
commit9080ba431deaaf411a1c7eab52277528006e3872 (patch)
tree7fa13a782c4ab496d80df5a482598fc4f835f6fb
parentc882c3240e6a244a8e782ddf7ce9a1c8022f935d (diff)
downloadlibtracker-tizen.tar.gz
libtracker-tizen.tar.bz2
libtracker-tizen.zip
Change-Id: I9ee780ff0f5297922b5469cb78804df1ff38942f Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
-rw-r--r--include/tracker.h1
-rw-r--r--src/tracker.c4
2 files changed, 3 insertions, 2 deletions
diff --git a/include/tracker.h b/include/tracker.h
index a9e2519..8181e68 100644
--- a/include/tracker.h
+++ b/include/tracker.h
@@ -53,6 +53,7 @@ typedef enum {
} tracker_service_e;
typedef enum {
+ TRACKER_TYPE_INVALID = -1,
TRACKER_TYPE_POWER_LOCK = 0,
TRACKER_TYPE_MAX
} tracker_type_e;
diff --git a/src/tracker.c b/src/tracker.c
index 4b34711..8f55549 100644
--- a/src/tracker.c
+++ b/src/tracker.c
@@ -24,7 +24,7 @@ API int tracker_get_ref_counter(tracker_type_e type, int *cnt)
{
int ref;
- if (type < 0 || type >= TRACKER_TYPE_MAX || !trackers[type]) {
+ if (type <= TRACKER_TYPE_INVALID || type >= TRACKER_TYPE_MAX || !trackers[type]) {
_E("Try to access not existed tracker %d", type);
return TRACKER_ERROR_INVALID_PARAMETER;
}
@@ -43,7 +43,7 @@ API int tracker_get_tick(tracker_type_e type, int *cnt)
{
int count;
- if (type < 0 || type >= TRACKER_TYPE_MAX || !trackers[type]) {
+ if (type <= TRACKER_TYPE_INVALID || type >= TRACKER_TYPE_MAX || !trackers[type]) {
_E("Try to access not existed tracker %d", type);
return TRACKER_ERROR_INVALID_PARAMETER;
}