Reviewed-by: Havoc Pennington <hp@pobox.com>
Signed-off-by: Will Thompson <will.thompson@collabora.co.uk>
int
dbus_watch_get_fd (DBusWatch *watch)
{
int
dbus_watch_get_fd (DBusWatch *watch)
{
+ _dbus_return_val_if_fail (watch != NULL, -1);
+
return dbus_watch_get_unix_fd(watch);
}
return dbus_watch_get_unix_fd(watch);
}
int
dbus_watch_get_unix_fd (DBusWatch *watch)
{
int
dbus_watch_get_unix_fd (DBusWatch *watch)
{
+ _dbus_return_val_if_fail (watch != NULL, -1);
+
/* FIXME remove #ifdef and do this on a lower level
* (watch should have set_socket and set_unix_fd and track
* which it has, and the transport should provide the
/* FIXME remove #ifdef and do this on a lower level
* (watch should have set_socket and set_unix_fd and track
* which it has, and the transport should provide the
int
dbus_watch_get_socket (DBusWatch *watch)
{
int
dbus_watch_get_socket (DBusWatch *watch)
{
+ _dbus_return_val_if_fail (watch != NULL, -1);
+
unsigned int
dbus_watch_get_flags (DBusWatch *watch)
{
unsigned int
dbus_watch_get_flags (DBusWatch *watch)
{
+ _dbus_return_val_if_fail (watch != NULL, 0);
_dbus_assert ((watch->flags & VALID_WATCH_FLAGS) == watch->flags);
return watch->flags;
_dbus_assert ((watch->flags & VALID_WATCH_FLAGS) == watch->flags);
return watch->flags;
void*
dbus_watch_get_data (DBusWatch *watch)
{
void*
dbus_watch_get_data (DBusWatch *watch)
{
+ _dbus_return_val_if_fail (watch != NULL, NULL);
+
void *data,
DBusFreeFunction free_data_function)
{
void *data,
DBusFreeFunction free_data_function)
{
+ _dbus_return_if_fail (watch != NULL);
+
_dbus_verbose ("Setting watch fd %d data to data = %p function = %p from data = %p function = %p\n",
dbus_watch_get_socket (watch),
data, free_data_function, watch->data, watch->free_data_function);
_dbus_verbose ("Setting watch fd %d data to data = %p function = %p from data = %p function = %p\n",
dbus_watch_get_socket (watch),
data, free_data_function, watch->data, watch->free_data_function);
dbus_bool_t
dbus_watch_get_enabled (DBusWatch *watch)
{
dbus_bool_t
dbus_watch_get_enabled (DBusWatch *watch)
{
- _dbus_assert (watch != NULL);
+ _dbus_return_val_if_fail (watch != NULL, FALSE);
+
dbus_watch_handle (DBusWatch *watch,
unsigned int flags)
{
dbus_watch_handle (DBusWatch *watch,
unsigned int flags)
{
+ _dbus_return_val_if_fail (watch != NULL, FALSE);
+
#ifndef DBUS_DISABLE_CHECKS
if (watch->fd < 0 || watch->flags == 0)
{
#ifndef DBUS_DISABLE_CHECKS
if (watch->fd < 0 || watch->flags == 0)
{