summaryrefslogtreecommitdiff
path: root/src/lib/ecore_con/efl_net_server_unix.c
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2016-11-25 18:01:29 -0200
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>2016-11-25 18:01:29 -0200
commit48049a4ce24d9bc71cdd73033f2fa6c6281f3b87 (patch)
tree25e325a20206e2e6276f9c834729dbdc15abffdd /src/lib/ecore_con/efl_net_server_unix.c
parent3346e6973b5e831e0db6ad3cd9034d5f6b663799 (diff)
efl_net_server_unix: add leading_directories_create property.
This allows us to crete any parent directories that are missing.
Diffstat (limited to '')
-rw-r--r--src/lib/ecore_con/efl_net_server_unix.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/lib/ecore_con/efl_net_server_unix.c b/src/lib/ecore_con/efl_net_server_unix.c
index 53deb4d3e1..b407d91233 100644
--- a/src/lib/ecore_con/efl_net_server_unix.c
+++ b/src/lib/ecore_con/efl_net_server_unix.c
@@ -24,6 +24,8 @@
24 24
25typedef struct _Efl_Net_Server_Unix_Data 25typedef struct _Efl_Net_Server_Unix_Data
26{ 26{
27 unsigned int leading_directories_create_mode;
28 Eina_Bool leading_directories_create;
27 Eina_Bool unlink_before_bind; 29 Eina_Bool unlink_before_bind;
28} Efl_Net_Server_Unix_Data; 30} Efl_Net_Server_Unix_Data;
29 31
@@ -54,6 +56,9 @@ _efl_net_server_unix_bind(Eo *o, Efl_Net_Server_Unix_Data *pd)
54 56
55 efl_net_server_fd_family_set(o, AF_UNIX); 57 efl_net_server_fd_family_set(o, AF_UNIX);
56 58
59 if (pd->leading_directories_create)
60 _ecore_con_local_mkpath(address, pd->leading_directories_create_mode);
61
57 do 62 do
58 { 63 {
59 fd = efl_net_socket4(AF_UNIX, SOCK_STREAM, 0, 64 fd = efl_net_socket4(AF_UNIX, SOCK_STREAM, 0,
@@ -272,4 +277,19 @@ _efl_net_server_unix_unlink_before_bind_get(Eo *o EINA_UNUSED, Efl_Net_Server_Un
272 return pd->unlink_before_bind; 277 return pd->unlink_before_bind;
273} 278}
274 279
280
281static void
282_efl_net_server_unix_leading_directories_create_set(Eo *o EINA_UNUSED, Efl_Net_Server_Unix_Data *pd, Eina_Bool do_it, unsigned int mode)
283{
284 pd->leading_directories_create = do_it;
285 pd->leading_directories_create_mode = mode;
286}
287
288static void
289_efl_net_server_unix_leading_directories_create_get(Eo *o EINA_UNUSED, Efl_Net_Server_Unix_Data *pd, Eina_Bool *do_it, unsigned int *mode)
290{
291 if (do_it) *do_it = pd->leading_directories_create;
292 if (mode) *mode = pd->leading_directories_create_mode;
293}
294
275#include "efl_net_server_unix.eo.c" 295#include "efl_net_server_unix.eo.c"