diff options
author | pr.jung <pr.jung@samsung.com> | 2015-09-10 16:06:59 +0900 |
---|---|---|
committer | Taeyoung Kim <ty317.kim@samsung.com> | 2015-11-11 21:36:10 -0800 |
commit | 9f40ef7e7b6f4c08e61626f5b839ae7d32555340 (patch) | |
tree | bbc599df0360efd3a78ac3aa30c6171dece3f079 | |
parent | 2e8676d8f22c7e628f14f4cf440387731491c092 (diff) | |
download | libsvi-9f40ef7e7b6f4c08e61626f5b839ae7d32555340.tar.gz libsvi-9f40ef7e7b6f4c08e61626f5b839ae7d32555340.tar.bz2 libsvi-9f40ef7e7b6f4c08e61626f5b839ae7d32555340.zip |
Reset vibration path when path is null
Change-Id: I0867a349d06243798baaebbe1ec29611f510dc3e
Signed-off-by: pr.jung <pr.jung@samsung.com>
-rw-r--r-- | src/vibrator.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/vibrator.c b/src/vibrator.c index c8036fc..d267ff2 100644 --- a/src/vibrator.c +++ b/src/vibrator.c @@ -439,8 +439,16 @@ static int vibrator_set_path(feedback_pattern_e pattern, char *path) /* * check the path is valid - * if path is null, below operation is ignored + * if path is null, reset vibration path */ + if (!path) { + if (vib_info.data[pattern].changed) { + free(vib_info.data[pattern].changed); + vib_info.data[pattern].changed = NULL; + } + return 0; + } + if (path && stat(path, &buf)) { _E("%s is not presents", path); return -errno; |