|
From: Peter K. <pk...@us...> - 2001-10-04 10:04:08
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_misc.c 1.16 1.17=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Minor clean-up.
The diff of the modified file(s):
--- bt_misc.c 2001/10/03 17:45:11 1.16
+++ bt_misc.c 2001/10/04 10:04:07 1.17
@@ -340,6 +340,7 @@
perror("fd_setup");
exit(1);
}
+
/* speedstr is either "baudrate" or "baud_base/divisor",
* if there is a '/' we should use serial_struct and set=20
* baud_base and custom_divisor etc.
@@ -347,14 +348,15 @@
divisorp =3D strchr(speedstr, '/');
if (divisorp)
{
- divisorp++;
- divisor =3D atol(divisorp);
+ divisor =3D atol(divisorp+1);
}
+
if (tcgetattr(fd, &t) < 0)
{=20=20
perror("tcgetattr");
exit(1);
}
+
if (ioctl(fd, TIOCGSERIAL, &serial))
{
perror("Error getting serial_struct with TIOCGSERIAL");
@@ -400,27 +402,31 @@
perror("fd_setup : tcsetattr");
exit(1);
}
+
if (ioctl(fd, TIOCSSERIAL, &serial))
{
perror("Error setting serial_struct with TIOCSSERIAL");
}
+
return;
}
=20
-unsigned long speedstrtoli(const char *speedstr)
+unsigned long
+speedstrtoli(const char *speedstr)
{
unsigned long baudbase =3D atol(speedstr);
unsigned char *divisorp =3D strchr(speedstr, '/');
unsigned long divisor =3D 1;
+
if (divisorp)
{
- divisorp++;
- divisor =3D atol(divisorp);
+ divisor =3D atol(divisorp+1);
if (divisor =3D=3D 0) /* Just to be safe */
{
divisor =3D 1;
}
}
+
return baudbase/divisor;
}
=20
|