aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/config
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-03-25 17:56:10 +0100
committermarha <marha@users.sourceforge.net>2014-03-25 17:56:10 +0100
commitba6115f56f066621a20fa545ddd67721afd35523 (patch)
tree418b724d4f318d24dc8e5183e6b252922f85f149 /xorg-server/config
parenteb71c0f23999d1cc156e1821d73634ec79621fc2 (diff)
parente0927d908a12c9c140458c355b29b884a7705f2d (diff)
downloadvcxsrv-ba6115f56f066621a20fa545ddd67721afd35523.tar.gz
vcxsrv-ba6115f56f066621a20fa545ddd67721afd35523.tar.bz2
vcxsrv-ba6115f56f066621a20fa545ddd67721afd35523.zip
Merge remote-tracking branch 'origin/released'
Conflicts: xorg-server/hw/xwin/InitInput.c xorg-server/hw/xwin/InitOutput.c xorg-server/hw/xwin/winglobals.c xorg-server/hw/xwin/winglobals.h xorg-server/hw/xwin/winmsgwindow.c xorg-server/hw/xwin/winmultiwindowwm.c xorg-server/hw/xwin/winmultiwindowwndproc.c
Diffstat (limited to 'xorg-server/config')
-rw-r--r--xorg-server/config/config.c18
-rw-r--r--xorg-server/config/udev.c32
2 files changed, 9 insertions, 41 deletions
diff --git a/xorg-server/config/config.c b/xorg-server/config/config.c
index 883402bb5..97b621b89 100644
--- a/xorg-server/config/config.c
+++ b/xorg-server/config/config.c
@@ -132,10 +132,7 @@ config_odev_allocate_attribute_list(void)
{
struct OdevAttributes *attriblist;
- attriblist = malloc(sizeof(struct OdevAttributes));
- if (!attriblist)
- return NULL;
-
+ attriblist = XNFalloc(sizeof(struct OdevAttributes));
xorg_list_init(&attriblist->list);
return attriblist;
}
@@ -168,10 +165,7 @@ config_odev_find_or_add_attribute(struct OdevAttributes *attribs, int attrib)
if (oa)
return oa;
- oa = calloc(1, sizeof(struct OdevAttribute));
- if (!oa)
- return oa;
-
+ oa = XNFcalloc(sizeof(struct OdevAttribute));
oa->attrib_id = attrib;
xorg_list_append(&oa->member, &attribs->list);
@@ -185,11 +179,8 @@ config_odev_add_attribute(struct OdevAttributes *attribs, int attrib,
struct OdevAttribute *oa;
oa = config_odev_find_or_add_attribute(attribs, attrib);
- if (!oa)
- return FALSE;
-
free(oa->attrib_name);
- oa->attrib_name = strdup(attrib_name);
+ oa->attrib_name = XNFstrdup(attrib_name);
oa->attrib_type = ODEV_ATTRIB_STRING;
return TRUE;
}
@@ -201,9 +192,6 @@ config_odev_add_int_attribute(struct OdevAttributes *attribs, int attrib,
struct OdevAttribute *oa;
oa = config_odev_find_or_add_attribute(attribs, attrib);
- if (!oa)
- return FALSE;
-
oa->attrib_value = attrib_value;
oa->attrib_type = ODEV_ATTRIB_INT;
return TRUE;
diff --git a/xorg-server/config/udev.c b/xorg-server/config/udev.c
index d88abaaa1..a1b72c13b 100644
--- a/xorg-server/config/udev.c
+++ b/xorg-server/config/udev.c
@@ -55,7 +55,7 @@
static struct udev_monitor *udev_monitor;
#ifdef CONFIG_UDEV_KMS
-static Bool
+static void
config_udev_odev_setup_attribs(const char *path, const char *syspath,
int major, int minor,
config_odev_probe_proc_ptr probe_callback);
@@ -457,40 +457,20 @@ config_udev_fini(void)
#ifdef CONFIG_UDEV_KMS
-static Bool
+static void
config_udev_odev_setup_attribs(const char *path, const char *syspath,
int major, int minor,
config_odev_probe_proc_ptr probe_callback)
{
struct OdevAttributes *attribs = config_odev_allocate_attribute_list();
- int ret;
-
- if (!attribs)
- return FALSE;
-
- ret = config_odev_add_attribute(attribs, ODEV_ATTRIB_PATH, path);
- if (ret == FALSE)
- goto fail;
-
- ret = config_odev_add_attribute(attribs, ODEV_ATTRIB_SYSPATH, syspath);
- if (ret == FALSE)
- goto fail;
-
- ret = config_odev_add_int_attribute(attribs, ODEV_ATTRIB_MAJOR, major);
- if (ret == FALSE)
- goto fail;
- ret = config_odev_add_int_attribute(attribs, ODEV_ATTRIB_MINOR, minor);
- if (ret == FALSE)
- goto fail;
+ config_odev_add_attribute(attribs, ODEV_ATTRIB_PATH, path);
+ config_odev_add_attribute(attribs, ODEV_ATTRIB_SYSPATH, syspath);
+ config_odev_add_int_attribute(attribs, ODEV_ATTRIB_MAJOR, major);
+ config_odev_add_int_attribute(attribs, ODEV_ATTRIB_MINOR, minor);
/* ownership of attribs is passed to probe layer */
probe_callback(attribs);
- return TRUE;
-fail:
- config_odev_free_attributes(attribs);
- free(attribs);
- return FALSE;
}
void