diff options
Diffstat (limited to 'src/liveinfo.c')
-rw-r--r-- | src/liveinfo.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/liveinfo.c b/src/liveinfo.c index c81a3e9..ca86448 100644 --- a/src/liveinfo.c +++ b/src/liveinfo.c @@ -58,10 +58,12 @@ HAPI void liveinfo_fini(void) struct liveinfo *info; EINA_LIST_FREE(s_info.info_list, info) { - if (fclose(info->fp) != 0) + if (fclose(info->fp) != 0) { ErrPrint("fclose: %s\n", strerror(errno)); - if (unlink(info->fifo_name) < 0) + } + if (unlink(info->fifo_name) < 0) { ErrPrint("unlink: %s\n", strerror(errno)); + } DbgFree(info); } } @@ -107,8 +109,9 @@ HAPI struct liveinfo *liveinfo_create(pid_t pid, int handle) snprintf(info->fifo_name, sizeof(info->fifo_name), "/tmp/.live_info.%lf", util_timestamp()); if (mkfifo(info->fifo_name, 0644) < 0) { ErrPrint("mkfifo: %s\n", strerror(errno)); - if (unlink(info->fifo_name) < 0) + if (unlink(info->fifo_name) < 0) { ErrPrint("unlink: %s\n", strerror(errno)); + } DbgFree(info); return NULL; } @@ -137,8 +140,9 @@ HAPI int liveinfo_open_fifo(struct liveinfo *info) HAPI void liveinfo_close_fifo(struct liveinfo *info) { if (info->fp) { - if (fclose(info->fp) != 0) + if (fclose(info->fp) != 0) { ErrPrint("fclose: %s\n", strerror(errno)); + } info->fp = NULL; } } @@ -147,8 +151,9 @@ HAPI void liveinfo_destroy(struct liveinfo *info) { s_info.info_list = eina_list_remove(s_info.info_list, info); liveinfo_close_fifo(info); - if (unlink(info->fifo_name) < 0) + if (unlink(info->fifo_name) < 0) { ErrPrint("unlink: %s\n", strerror(errno)); + } DbgFree(info); } @@ -173,8 +178,9 @@ HAPI struct liveinfo *liveinfo_find_by_pid(pid_t pid) struct liveinfo *info; EINA_LIST_FOREACH(s_info.info_list, l, info) { - if (info->pid == pid) + if (info->pid == pid) { return info; + } } return NULL; @@ -186,8 +192,9 @@ HAPI struct liveinfo *liveinfo_find_by_handle(int handle) struct liveinfo *info; EINA_LIST_FOREACH(s_info.info_list, l, info) { - if (info->handle == handle) + if (info->handle == handle) { return info; + } } return NULL; |