summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2017-08-10 18:50:36 -0700
committerSimon McVittie <smcv@debian.org>2017-08-15 12:21:00 -0400
commit85c55e0c63ac643f7e35d8bcec044b20d0e29500 (patch)
tree768c3f9dc43a07fde38cb7c624cb2af59c71297c
parent81966a5252489f11d3a7f48aa7247b9029935c2f (diff)
Fix -Werror=declaration-after-statement build failure on Solaris
dbus-sysdeps-unix.c: In function ‘_dbus_read_credentials_socket’: dbus-sysdeps-unix.c:2061:9: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] adt_session_data_t *adth = NULL; ^ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=102145 Reviewed-by: Philip Withnall <withnall@endlessm.com> Reviewed-by: Simon McVittie <smcv@collabora.com>
-rw-r--r--dbus/dbus-sysdeps-unix.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c
index b7a26507..b2b30f19 100644
--- a/dbus/dbus-sysdeps-unix.c
+++ b/dbus/dbus-sysdeps-unix.c
@@ -2052,13 +2052,13 @@ _dbus_read_credentials_socket (DBusSocket client_fd,
ucred_t * ucred = NULL;
if (getpeerucred (client_fd.fd, &ucred) == 0)
{
+#ifdef HAVE_ADT
+ adt_session_data_t *adth = NULL;
+#endif
pid_read = ucred_getpid (ucred);
uid_read = ucred_geteuid (ucred);
#ifdef HAVE_ADT
/* generate audit session data based on socket ucred */
- adt_session_data_t *adth = NULL;
- adt_export_data_t *data = NULL;
- size_t size = 0;
if (adt_start_session (&adth, NULL, 0) || (adth == NULL))
{
_dbus_verbose ("Failed to adt_start_session(): %s\n", _dbus_strerror (errno));
@@ -2071,7 +2071,8 @@ _dbus_read_credentials_socket (DBusSocket client_fd,
}
else
{
- size = adt_export_session_data (adth, &data);
+ adt_export_data_t *data = NULL;
+ size_t size = adt_export_session_data (adth, &data);
if (size <= 0)
{
_dbus_verbose ("Failed to adt_export_session_data(): %s\n", _dbus_strerror (errno));