Apps count _may_ be equal to 0 (if we are attaching to an app, not
launching one).
Also assert for apps count >= 0 added.
Change-Id: Ia24f2856e4240b5e827026713f613238b36a870a
Signed-off-by: Nikita Kalyazin <n.kalyazin@samsung.com>
#include <linux/input.h>
#include <dirent.h>
#include <fcntl.h>
+
+#include <assert.h>
+
#include "daemon.h"
#include "sys_stat.h"
#include "utils.h"
int res = 0;
struct epoll_event ev;
- if (apps_count <= 0) {
- res = -1;
- LOGE("Wrong apps_count!\n");
+ assert(apps_count >= 0 && "negative apps count");
+
+ if (apps_count == 0)
return res;
- }
manager.app_launch_timerfd =
timerfd_create(CLOCK_REALTIME, TFD_CLOEXEC);