From: Bruno Dilly Date: Tue, 20 Sep 2016 23:13:25 +0000 (-0700) Subject: ecore_con,elput: fix warnings X-Git-Tag: upstream/1.20.0~4270 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a3fba57b2616f78fbdab7b43ac8e8aea7c56475b;p=platform%2Fupstream%2Fefl.git ecore_con,elput: fix warnings Summary: elput: fix warning for unused write result ecore_con: fix warning for unused asprintf result Reviewers: iscaro, devilhorns, cedric Reviewed By: cedric Subscribers: cedric, seoz, jpeg Differential Revision: https://phab.enlightenment.org/D4308 Signed-off-by: Cedric BAIL --- diff --git a/src/lib/ecore_con/ecore_con.c b/src/lib/ecore_con/ecore_con.c index cc17fe8..cb66b27 100644 --- a/src/lib/ecore_con/ecore_con.c +++ b/src/lib/ecore_con/ecore_con.c @@ -4487,11 +4487,18 @@ _efl_net_ip_connect_async_run(void *data, Ecore_Thread *thread EINA_UNUSED) * parameter must be a URL with schema, otherwise it won't * return anything. */ - char *url; + Eina_Stringshare *url; - asprintf(&url, "%s://%s:%s", d->protocol == IPPROTO_UDP ? "udp" : "tcp", host, port); - proxies = ecore_con_libproxy_proxies_get(url); - free(url); + url = eina_stringshare_printf("%s://%s:%s", d->protocol == IPPROTO_UDP ? "udp" : "tcp", host, port); + if (!url) + { + ERR("Could not assemble URL"); + } + else + { + proxies = ecore_con_libproxy_proxies_get(url); + eina_stringshare_del(url); + } } EINA_THREAD_CLEANUP_PUSH((Eina_Free_Cb)ecore_con_libproxy_proxies_free, proxies); diff --git a/src/lib/elput/elput_logind.c b/src/lib/elput/elput_logind.c index 5d97a02..abe4a38 100644 --- a/src/lib/elput/elput_logind.c +++ b/src/lib/elput/elput_logind.c @@ -276,7 +276,19 @@ _logind_device_release(Elput_Manager *em, uint32_t major, uint32_t minor) static void _logind_pipe_write_fd(Elput_Manager *em, int fd) { - write(em->input.pipe, &fd, sizeof(int)); + int ret; + + while (1) + { + ret = write(em->input.pipe, &fd, sizeof(int)); + if (ret < 0) + { + if ((errno == EAGAIN) || (errno == EINTR)) + continue; + WRN("Failed to write to input pipe"); + } + break; + } close(em->input.pipe); em->input.pipe = -1; }