|
From: Peter K. <pk...@us...> - 2001-09-10 11:59:55
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_if.c 1.33 1.34=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Made bt_set_max_conections() return -1 if it failed.
The diff of the modified file(s):
--- bt_if.c 2001/09/07 12:53:50 1.33
+++ bt_if.c 2001/09/10 11:59:54 1.34
@@ -621,36 +621,45 @@
=20
int bt_force_msswitch_as_server(int bt_cfd, int enable)
{
- int ret_val;
-
syslog(LOG_INFO, __FUNCTION__ ": %d", enable);
#ifndef BT_USERSTACK=20
- if ((ret_val =3D ioctl(bt_cfd, BTSETMSSWITCH, &enable)) < 0)
+ if (ioctl(bt_cfd, BTSETMSSWITCH, &enable) < 0)
{
- fprintf(stderr, __FUNCTION__ ": %s\n", error_msg(ret_val));
+ perror(__FUNCTION__);
+ return -1;
}
#else
hci_force_msswitch(enable);
#endif
- return ret_val;
+ return 0;
}
=20
int bt_set_max_conections(int bt_cfd, int connections)
{
- int ret_val;
-
syslog(LOG_INFO, __FUNCTION__ ": %d", connections);
#ifndef BT_USERSTACK=20
- if ((ret_val =3D ioctl(bt_cfd, BTSETMAXCONNECTIONS, &connections)) < 0)
+ if (ioctl(bt_cfd, BTSETMAXCONNECTIONS, &connections) < 0)
{
- fprintf(stderr, __FUNCTION__ ": %s\n", error_msg(ret_val));
+ perror(__FUNCTION__);
+ return -1;
}
+
+ return 0;
#else
- printf(__FUNCTION__": not implemented in userstack mode!\n"
-#endif
+ {
+ int ret_val =3D hci_set_max_connections(connections);
+
+ if (ret_val >=3D 0)
+ {
return ret_val;
}
=20
+ errno =3D -ret_val;
+ return -1;
+ }
+#endif
+}
+
/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
/* HCI functions */
=20
|