From: David van Moolenbroek Date: Fri, 4 Oct 2013 16:00:42 +0000 (+0200) Subject: UDS: align struct sockaddr_un with NetBSD X-Git-Tag: v3.3.0~538 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/verify-sign/tz-link.htm?a=commitdiff_plain;h=10a344c3fd6626751d9e1d04887eb42e41c66ce0;p=minix.git UDS: align struct sockaddr_un with NetBSD Well, make a start, anyway. Our copy was missing a legacy field from the structure, that could very well cause applications to fail trying to set, clear, or check it. As a consequence, SUN_LEN now yields the same result as on NetBSD. Change-Id: I80f6aff7769be402b3bd3959f64d314509ed138c --- diff --git a/sys/sys/un.h b/sys/sys/un.h index c3c4b71fe..537149225 100644 --- a/sys/sys/un.h +++ b/sys/sys/un.h @@ -16,6 +16,7 @@ typedef __sa_family_t sa_family_t; * Definitions for UNIX IPC domain. */ struct sockaddr_un { + uint8_t sun_len; sa_family_t sun_family; char sun_path[UNIX_PATH_MAX]; }; diff --git a/test/test56.c b/test/test56.c index fb13872c4..6b46d9fdf 100644 --- a/test/test56.c +++ b/test/test56.c @@ -302,8 +302,8 @@ void test_header(void) sun.sun_path[2] = 'x'; sun.sun_path[3] = '\0'; - if (SUN_LEN(&sun) != 4) { - test_fail("SUN_LEN(&sun) should be 4"); + if (SUN_LEN(&sun) != 5) { + test_fail("SUN_LEN(&sun) should be 5"); } if (PF_UNIX != PF_LOCAL || PF_UNIX != PF_FILE || PF_UNIX != AF_UNIX) {