aboutsummaryrefslogtreecommitdiff
path: root/gconf/gconf-gram.y
diff options
context:
space:
mode:
Diffstat (limited to 'gconf/gconf-gram.y')
-rw-r--r--gconf/gconf-gram.y20
1 files changed, 13 insertions, 7 deletions
diff --git a/gconf/gconf-gram.y b/gconf/gconf-gram.y
index a1d9f2a..f7ee710 100644
--- a/gconf/gconf-gram.y
+++ b/gconf/gconf-gram.y
@@ -508,3 +508,3 @@ string_to_host (struct in_addr *in, const char *string)
static int
-string_to_sockaddr (sockaddr_union_t *s, const char *string)
+string_to_sockaddr (struct gconf_sockaddr *sp, const char *string)
{
@@ -512,3 +512,4 @@ string_to_sockaddr (sockaddr_union_t *s, const char *string)
{
- if (strlen (string) >= sizeof (s->s_un.sun_path))
+ struct sockaddr_un s_un;
+ if (strlen (string) >= sizeof (s_un.sun_path))
{
@@ -519,4 +520,7 @@ string_to_sockaddr (sockaddr_union_t *s, const char *string)
}
- s->s_un.sun_family = AF_UNIX;
- strcpy (s->s_un.sun_path, string);
+ s_un.sun_family = AF_UNIX;
+ strcpy (s_un.sun_path, string);
+ sp->len = sizeof (s_un);
+ sp->sa = xmalloc (sp->len);
+ memcpy (sp->sa, &s_un, sp->len);
}
@@ -585,3 +589,5 @@ string_to_sockaddr (sockaddr_union_t *s, const char *string)
}
- s->s_in = sa;
+ sp->len = sizeof (sa);
+ sp->sa = xmalloc (sp->len);
+ memcpy (sp->sa, &sa, sp->len);
}
@@ -691,3 +697,3 @@ string_convert (void *target, enum gconf_data_type type, const char *string)
case gconf_type_sockaddr:
- return string_to_sockaddr ((sockaddr_union_t*)target, string);
+ return string_to_sockaddr ((struct gconf_sockaddr *)target, string);
@@ -722,3 +728,3 @@ size_t gconf_type_size_tab[] = {
sizeof (struct in_addr) /* gconf_type_host */,
- sizeof (sockaddr_union_t) /* gconf_type_sockaddr */,
+ sizeof (struct gconf_sockaddr) /* gconf_type_sockaddr */,
0 /* gconf_type_section */

Return to:

Send suggestions and report system problems to the System administrator.