static void prepare_monitor(sd_device_monitor **ret_server, sd_device_monitor **ret_client, union sockaddr_union *ret_address) {
_cleanup_(sd_device_monitor_unrefp) sd_device_monitor *monitor_server = NULL, *monitor_client = NULL;
- ASSERT_OK(device_monitor_new_full(&monitor_server, MONITOR_GROUP_NONE, -1));
+ ASSERT_OK(device_monitor_new_full(&monitor_server, MONITOR_GROUP_NONE, -EBADF));
ASSERT_OK(sd_device_monitor_set_description(monitor_server, "sender"));
ASSERT_OK(sd_device_monitor_start(monitor_server, NULL, NULL));
- ASSERT_OK(device_monitor_new_full(&monitor_client, MONITOR_GROUP_NONE, -1));
+ ASSERT_OK(device_monitor_new_full(&monitor_client, MONITOR_GROUP_NONE, -EBADF));
ASSERT_OK(sd_device_monitor_set_description(monitor_client, "client"));
ASSERT_OK(device_monitor_allow_unicast_sender(monitor_client, monitor_server));
ASSERT_OK(device_monitor_get_address(monitor_client, ret_address));
ASSERT_OK_ZERO(sd_device_monitor_is_running(NULL));
- ASSERT_OK(device_monitor_new_full(&m, MONITOR_GROUP_NONE, -1));
+ ASSERT_OK(device_monitor_new_full(&m, MONITOR_GROUP_NONE, -EBADF));
ASSERT_OK_ZERO(sd_device_monitor_is_running(m));
ASSERT_OK(sd_device_monitor_start(m, NULL, NULL));
ASSERT_OK_POSITIVE(sd_device_monitor_is_running(m));
if (g < 0)
return_with_errno(NULL, EINVAL);
- r = device_monitor_new_full(&m, g, -1);
+ r = device_monitor_new_full(&m, g, -EBADF);
if (r < 0)
return_with_errno(NULL, r);
const char *subsystem, *devtype, *tag;
int r;
- r = device_monitor_new_full(&monitor, sender, -1);
+ r = device_monitor_new_full(&monitor, sender, -EBADF);
if (r < 0)
return log_error_errno(r, "Failed to create netlink socket: %m");