"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "test/fdpass.c" between
dbus-1.12.16.tar.gz and dbus-1.12.18.tar.gz

About: D-Bus is an inter-process communication (IPC) system, allowing multiple, concurrently-running applications to communicate with one another. D-Bus supplies both a system daemon and a per-user-login-session daemon.

fdpass.c  (dbus-1.12.16):fdpass.c  (dbus-1.12.18)
skipping to change at line 53 skipping to change at line 53
# include <sys/resource.h> # include <sys/resource.h>
# endif # endif
# include <sys/stat.h> # include <sys/stat.h>
# include <sys/time.h> # include <sys/time.h>
# include <sys/types.h> # include <sys/types.h>
# include <unistd.h> # include <unistd.h>
#endif #endif
#include "test-utils-glib.h" #include "test-utils-glib.h"
#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include <dbus/dbus-message-internal.h>
#else
typedef struct _DBusInitialFDs DBusInitialFDs;
#define _dbus_check_fdleaks_enter() NULL
#define _dbus_check_fdleaks_leave(fds) do {} while (0)
#endif
/* Arbitrary; included here to avoid relying on the default */ /* Arbitrary; included here to avoid relying on the default */
#define MAX_MESSAGE_UNIX_FDS 20 #define MAX_MESSAGE_UNIX_FDS 20
/* This test won't work on Linux unless this is true. */ /* This test won't work on Linux unless this is true. */
_DBUS_STATIC_ASSERT (MAX_MESSAGE_UNIX_FDS <= 253); _DBUS_STATIC_ASSERT (MAX_MESSAGE_UNIX_FDS <= 253);
/* Arbitrary; included here to avoid relying on the default. */ /* Arbitrary; included here to avoid relying on the default. */
#define MAX_INCOMING_UNIX_FDS (MAX_MESSAGE_UNIX_FDS * 4) #define MAX_INCOMING_UNIX_FDS (MAX_MESSAGE_UNIX_FDS * 4)
/* Arbitrary, except that MAX_MESSAGE_UNIX_FDS * SOME_MESSAGES should be /* Arbitrary, except that MAX_MESSAGE_UNIX_FDS * SOME_MESSAGES should be
* less than the process's file descriptor limit. */ * less than the process's file descriptor limit. */
skipping to change at line 95 skipping to change at line 103
DBusConnection *left_client_conn; DBusConnection *left_client_conn;
DBusConnection *left_server_conn; DBusConnection *left_server_conn;
DBusConnection *right_server_conn; DBusConnection *right_server_conn;
DBusConnection *right_client_conn; DBusConnection *right_client_conn;
/* queue of DBusMessage received by right_client_conn */ /* queue of DBusMessage received by right_client_conn */
GQueue messages; GQueue messages;
int fd_before; int fd_before;
DBusInitialFDs *initial_fds;
} Fixture; } Fixture;
static void oom (const gchar *doing) G_GNUC_NORETURN; static void oom (const gchar *doing) G_GNUC_NORETURN;
static void static void
oom (const gchar *doing) oom (const gchar *doing)
{ {
g_error ("out of memory (%s)", doing); g_error ("out of memory (%s)", doing);
abort (); abort ();
} }
skipping to change at line 179 skipping to change at line 188
static void static void
test_connect (Fixture *f, test_connect (Fixture *f,
gboolean should_support_fds) gboolean should_support_fds)
{ {
char *address; char *address;
if (f->skip) if (f->skip)
return; return;
f->initial_fds = _dbus_check_fdleaks_enter ();
g_assert (f->left_server_conn == NULL); g_assert (f->left_server_conn == NULL);
g_assert (f->right_server_conn == NULL); g_assert (f->right_server_conn == NULL);
address = dbus_server_get_address (f->server); address = dbus_server_get_address (f->server);
g_assert (address != NULL); g_assert (address != NULL);
f->left_client_conn = dbus_connection_open_private (address, &f->e); f->left_client_conn = dbus_connection_open_private (address, &f->e);
assert_no_error (&f->e); assert_no_error (&f->e);
g_assert (f->left_client_conn != NULL); g_assert (f->left_client_conn != NULL);
test_connection_setup (f->ctx, f->left_client_conn); test_connection_setup (f->ctx, f->left_client_conn);
skipping to change at line 874 skipping to change at line 885
f->server = NULL; f->server = NULL;
} }
if (f->ctx != NULL) if (f->ctx != NULL)
test_main_context_unref (f->ctx); test_main_context_unref (f->ctx);
#ifdef HAVE_UNIX_FD_PASSING #ifdef HAVE_UNIX_FD_PASSING
if (f->fd_before >= 0 && close (f->fd_before) < 0) if (f->fd_before >= 0 && close (f->fd_before) < 0)
g_error ("%s", g_strerror (errno)); g_error ("%s", g_strerror (errno));
#endif #endif
if (f->initial_fds != NULL)
_dbus_check_fdleaks_leave (f->initial_fds);
} }
int int
main (int argc, main (int argc,
char **argv) char **argv)
{ {
test_init (&argc, &argv); test_init (&argc, &argv);
#ifdef HAVE_GETRLIMIT #ifdef HAVE_GETRLIMIT
{ {
 End of changes. 4 change blocks. 
0 lines changed or deleted 14 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)