diff options
-rw-r--r-- | src/lib/evas/Evas.h | 14 | ||||
-rw-r--r-- | src/lib/evas/cserve2/evas_cs2_client.c | 8 | ||||
-rw-r--r-- | src/lib/evas/file/evas_module.c | 43 |
3 files changed, 61 insertions, 4 deletions
diff --git a/src/lib/evas/Evas.h b/src/lib/evas/Evas.h index c1f418b1e9..c7ccfb4225 100644 --- a/src/lib/evas/Evas.h +++ b/src/lib/evas/Evas.h | |||
@@ -1245,6 +1245,20 @@ typedef void (*Evas_Async_Events_Put_Cb)(void *target, Evas_Callback_Type t | |||
1245 | */ | 1245 | */ |
1246 | 1246 | ||
1247 | /** | 1247 | /** |
1248 | * Get the path for the cserve binary to execute | ||
1249 | * | ||
1250 | * There is little need for anyone except a desktop nevironment to call this. | ||
1251 | * This can be called before evas_init() has been called. It will try and find | ||
1252 | * the full path to the to the cserve binary to run to provide cserve image | ||
1253 | * and font caching services for evas. | ||
1254 | * | ||
1255 | * @return NULL if error, or a string with the full path to the cserve binary. | ||
1256 | * | ||
1257 | * @since 1.8 | ||
1258 | */ | ||
1259 | EAPI const char *evas_cserve_path_get(void); | ||
1260 | |||
1261 | /** | ||
1248 | * Initialize Evas | 1262 | * Initialize Evas |
1249 | * | 1263 | * |
1250 | * @return The init counter value. | 1264 | * @return The init counter value. |
diff --git a/src/lib/evas/cserve2/evas_cs2_client.c b/src/lib/evas/cserve2/evas_cs2_client.c index 73bbcf1de7..3cb12d4f89 100644 --- a/src/lib/evas/cserve2/evas_cs2_client.c +++ b/src/lib/evas/cserve2/evas_cs2_client.c | |||
@@ -106,11 +106,11 @@ _server_connect(void) | |||
106 | remote.sun_family = AF_UNIX; | 106 | remote.sun_family = AF_UNIX; |
107 | _socket_path_set(remote.sun_path); | 107 | _socket_path_set(remote.sun_path); |
108 | len = strlen(remote.sun_path) + sizeof(remote.sun_family); | 108 | len = strlen(remote.sun_path) + sizeof(remote.sun_family); |
109 | if (connect(s, (struct sockaddr *)&remote, len) == -1) | 109 | for (;;) |
110 | { | 110 | { |
111 | ERR("connect"); | 111 | if (connect(s, (struct sockaddr *)&remote, len) != -1) break; |
112 | close(s); | 112 | ERR("cserve connect failed. retrying."); |
113 | return EINA_FALSE; | 113 | usleep(1000); |
114 | } | 114 | } |
115 | 115 | ||
116 | fcntl(s, F_SETFL, O_NONBLOCK); | 116 | fcntl(s, F_SETFL, O_NONBLOCK); |
diff --git a/src/lib/evas/file/evas_module.c b/src/lib/evas/file/evas_module.c index 0378423a6a..0a5e302a22 100644 --- a/src/lib/evas/file/evas_module.c +++ b/src/lib/evas/file/evas_module.c | |||
@@ -615,3 +615,46 @@ _evas_module_libdir_get(void) | |||
615 | if (!pfx) return NULL; | 615 | if (!pfx) return NULL; |
616 | return eina_prefix_lib_get(pfx); | 616 | return eina_prefix_lib_get(pfx); |
617 | } | 617 | } |
618 | |||
619 | EAPI const char * | ||
620 | evas_cserve_path_get(void) | ||
621 | { | ||
622 | static char buf[PATH_MAX]; | ||
623 | const char *lib; | ||
624 | Eina_Bool shutdown = EINA_FALSE; | ||
625 | |||
626 | if (!pfx) | ||
627 | { | ||
628 | shutdown = EINA_TRUE; | ||
629 | eina_init(); | ||
630 | pfx = eina_prefix_new | ||
631 | (NULL, _evas_module_libdir_get, "EVAS", "evas", "checkme", | ||
632 | PACKAGE_BIN_DIR, PACKAGE_LIB_DIR, | ||
633 | PACKAGE_DATA_DIR, PACKAGE_DATA_DIR); | ||
634 | if (!pfx) | ||
635 | { | ||
636 | eina_shutdown(); | ||
637 | return NULL; | ||
638 | } | ||
639 | } | ||
640 | lib = eina_prefix_lib_get(pfx); | ||
641 | if (!lib) | ||
642 | { | ||
643 | if (shutdown) | ||
644 | { | ||
645 | eina_prefix_free(pfx); | ||
646 | pfx = NULL; | ||
647 | eina_shutdown(); | ||
648 | } | ||
649 | return NULL; | ||
650 | } | ||
651 | snprintf(buf, sizeof(buf), "%s/evas/cserve2/bin/%s/evas_cserve2", | ||
652 | lib, MODULE_ARCH); | ||
653 | if (shutdown) | ||
654 | { | ||
655 | eina_prefix_free(pfx); | ||
656 | pfx = NULL; | ||
657 | eina_shutdown(); | ||
658 | } | ||
659 | return buf; | ||
660 | } | ||