From: Marc-André Lureau Date: Tue, 8 Feb 2022 10:25:08 +0000 (+0400) Subject: dbus: move _DBUS_MAX_SUN_PATH_LENGTH to sysdeps.h X-Git-Tag: dbus-1.15.0~26^2~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0cf03ce49b81f8bed6ba65a4dd438a65844a369d;p=thirdparty%2Fdbus.git dbus: move _DBUS_MAX_SUN_PATH_LENGTH to sysdeps.h Share the same constant for all systems. Signed-off-by: Marc-André Lureau --- diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c index fc0a47779..18bd12828 100644 --- a/dbus/dbus-sysdeps-unix.c +++ b/dbus/dbus-sysdeps-unix.c @@ -935,21 +935,6 @@ _dbus_write_two (int fd, #endif /* !HAVE_WRITEV */ } -#define _DBUS_MAX_SUN_PATH_LENGTH 99 - -/** - * @def _DBUS_MAX_SUN_PATH_LENGTH - * - * Maximum length of the path to a UNIX domain socket, - * sockaddr_un::sun_path member. POSIX requires that all systems - * support at least 100 bytes here, including the nul termination. - * We use 99 for the max value to allow for the nul. - * - * We could probably also do sizeof (addr.sun_path) - * but this way we are the same on all platforms - * which is probably a good idea. - */ - /** * Creates a socket and connects it to the UNIX domain socket at the * given path. The connection fd is returned, and is set up as diff --git a/dbus/dbus-sysdeps.h b/dbus/dbus-sysdeps.h index 1c6b76153..5270a5dec 100644 --- a/dbus/dbus-sysdeps.h +++ b/dbus/dbus-sysdeps.h @@ -730,6 +730,20 @@ void _dbus_combine_tcp_errors (DBusList **sources, const char *port, DBusError *dest); +/** + * @def _DBUS_MAX_SUN_PATH_LENGTH + * + * Maximum length of the path to a UNIX domain socket, + * sockaddr_un::sun_path member. POSIX requires that all systems + * support at least 100 bytes here, including the nul termination. + * We use 99 for the max value to allow for the nul. + * + * We could probably also do sizeof (addr.sun_path) + * but this way we are the same on all platforms + * which is probably a good idea. + */ +#define _DBUS_MAX_SUN_PATH_LENGTH 99 + /** @} */ DBUS_END_DECLS