|
From: Mattias ?g. <mat...@us...> - 2001-03-02 14:29:15
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_misc.c 1.1 1.2=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
added 921,6 kbps option int translate_speed
The diff of the modified file(s):
--- bt_misc.c 2001/03/02 10:59:57 1.1
+++ bt_misc.c 2001/03/02 14:30:32 1.2
@@ -280,6 +280,13 @@
case 460800:
speed_c =3D B460800;
break;
+
+#ifdef __CRIS__
+ case 921600:
+ speed_c =3D B921600;
+ break;
+#endif
+
default:
printf("Bad baudrate %d.\n", spd);
break;
|
|
From: Mattias A. <mat...@us...> - 2001-03-21 18:24:42
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_misc.c 1.2 1.3=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
return -1 if connect fails in open_socket
changed get_local_addr, free string after strdup
modified set_pin_code
The diff of the modified file(s):
--- bt_misc.c 2001/03/02 14:30:32 1.2
+++ bt_misc.c 2001/03/21 18:24:40 1.3
@@ -136,7 +136,7 @@
(struct sockaddr *)&server_address,=20
server_len) < 0) {
syslog(LOG_ERR, "open_socket %s failed", name);
- return 0;
+ return -1;
}
=20
=20
@@ -234,7 +234,7 @@
* Set server_name to the numerical IP of eth0 instead of using DNS or
* relying on /etc/hosts being correct. for now.
*/
-char* get_local_addr(void)
+void get_local_addr(char *str)
{
char *local_address =3D NULL;
int fd =3D socket(AF_INET, SOCK_DGRAM, 0);
@@ -249,7 +249,10 @@
{
syslog(LOG_INFO, "could not determine local IP address!\n");
}
- return local_address;
+
+ strcpy(str, local_address);
+
+ free(local_address);
}
=20
int=20
@@ -339,7 +342,7 @@
}
=20
void=20
-print_data(const char *message, char *buf, int len)
+print_data(const char *message, unsigned char *buf, int len)
{=20
int t;
printf("\n%s (%d)", message, len);
@@ -347,7 +350,7 @@
{
if((t%16)=3D=3D0)
printf("\n ");
- printf("0x%x ", buf[t]);
+ printf("0x%02x ", (uint)(buf[t]));
}
printf("\n");
}
@@ -362,14 +365,13 @@
if (strncmp(pin, "disable", 7) =3D=3D 0)
{
printf("Disable PIN usage\n");
- system("/bin/parhandclient -nosync set root.Security.UseLANSecurity ye=
s");
+ system("/bin/parhandclient -nosync set root.Security.UseLANSecurity no=
");
system("/bin/parhandclient sync");
return;
}
=20
- sprintf(exec_pinstr, "/bin/parhandclient -nosync set root.Security.PINCo=
de %s", (char*) pin);
-=20=20
/* Set pin in stack */
+ sprintf(exec_pinstr, "/bin/parhandclient -nosync set root.Security.PINCo=
de %s", (char*) pin);=20=20
=20=20=20
system("/bin/parhandclient -nosync set root.Security.UseLANSecurity yes"=
);
system(exec_pinstr);
|
|
From: Peter K. <pk...@us...> - 2001-04-04 10:31:21
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_misc.c 1.3 1.4=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* Allow 921600 as baud rate also for non-CRIS compiles.
* Minor clean-up.
The diff of the modified file(s):
--- bt_misc.c 2001/03/21 18:24:40 1.3
+++ bt_misc.c 2001/04/04 10:31:19 1.4
@@ -201,7 +201,6 @@
&client_len);
=20=20=20=20=20
return client_sockfd;
-
}
else
{
@@ -283,12 +282,9 @@
case 460800:
speed_c =3D B460800;
break;
-
-#ifdef __CRIS__
case 921600:
speed_c =3D B921600;
break;
-#endif
=20
default:
printf("Bad baudrate %d.\n", spd);
@@ -345,12 +341,13 @@
print_data(const char *message, unsigned char *buf, int len)
{=20
int t;
+
printf("\n%s (%d)", message, len);
for (t=3D0;t<len;t++)=20
{
- if((t%16)=3D=3D0)
+ if(!(t % 16))
printf("\n ");
- printf("0x%02x ", (uint)(buf[t]));
+ printf("0x%02x ", (uint)buf[t]);
}
printf("\n");
}
@@ -359,25 +356,20 @@
void set_pin_code(char *pin)
{
#ifdef __CRIS__
- /* Set pincode */
char exec_pinstr[100];=20=20=20=20=20=20=20=20
=20
- if (strncmp(pin, "disable", 7) =3D=3D 0)
+ if (strcmp(pin, "disable") =3D=3D 0)
{
printf("Disable PIN usage\n");
- system("/bin/parhandclient -nosync set root.Security.UseLANSecurity no=
");
- system("/bin/parhandclient sync");
+ system("/bin/parhandclient -nosync set root.Security.UseLANSecurity no=
sync");
return;
}
-
- /* Set pin in stack */
- sprintf(exec_pinstr, "/bin/parhandclient -nosync set root.Security.PINCo=
de %s", (char*) pin);=20=20
=20=20=20
+ /* Set pinconde */
system("/bin/parhandclient -nosync set root.Security.UseLANSecurity yes"=
);
+ sprintf(exec_pinstr, "/bin/parhandclient -nosync set root.Security.PINCo=
de %s sync", pin);=20=20
system(exec_pinstr);
- system("/bin/parhandclient sync");
#else
- printf("set_pin_code not implemented [%s, line %d]\n",=20
- __FILE__, __LINE__);
+ printf("set_pin_code not implemented [%s, line %d]\n", __FILE__, __LINE_=
_);
#endif
}
|
|
From: Peter K. <pk...@us...> - 2001-04-11 12:24:22
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_misc.c 1.5 1.6=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
open_tcpsocket() no longer crashes if there is no colon in
the address string. Instead it terminates the program
(thanks to Salil Gokhale for finding this).
The diff of the modified file(s):
--- bt_misc.c 2001/04/04 10:43:04 1.5
+++ bt_misc.c 2001/04/11 12:24:22 1.6
@@ -119,8 +119,6 @@
client_sockfd =3D accept(server_sockfd,=20
(struct sockaddr *)&(client_address),
&client_len);
-=20=20=20=20
- return client_sockfd;
}
else
{
@@ -139,10 +137,10 @@
return -1;
}
=20
-
syslog(LOG_INFO, "Socket connected to %s\n", server_address.sun_path);
- return client_sockfd;
}
+
+ return client_sockfd;
}
=20
/* TCP socket */
@@ -161,11 +159,16 @@
=20=20=20
/*parse address string */
=20
- pos =3D strchr(addrstr, ':');
+ if (!(pos =3D strchr(addrstr, ':')))
+ {
+ fprintf(stderr, "Port argument missing!\n");
+ exit(1);
+ }
=20
/* copy ip address */
- memcpy(ipstr, addrstr, pos-addrstr);
- ipstr[pos-addrstr]=3D0; /* null term */
+ *pos =3D '\0';
+ strncpy(ipstr, addrstr, sizeof ipstr);
+ ipstr[sizeof ipstr - 1] =3D '\0';
=20
/* extract port number */
port =3D atoi(pos+1);
@@ -199,8 +202,6 @@
client_sockfd =3D accept(server_sockfd,
(struct sockaddr *)&(client_address),
&client_len);
-=20=20=20=20
- return client_sockfd;
}
else
{
@@ -223,9 +224,9 @@
perror("open_tcpsocket");
exit(1);
}
+ }
=20
return client_sockfd;
- }
}
=20
=20
|
|
From: Mattias A. <mat...@us...> - 2001-04-25 18:04:24
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_misc.c 1.6 1.7=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* only use print_data when not running usermode stack
The diff of the modified file(s):
--- bt_misc.c 2001/04/11 12:24:22 1.6
+++ bt_misc.c 2001/04/25 18:04:23 1.7
@@ -342,6 +342,7 @@
return buf;
}
=20
+#ifndef BT_USERSTACK
void=20
print_data(const char *message, unsigned char *buf, int len)
{=20
@@ -356,6 +357,7 @@
}
printf("\n");
}
+#endif
=20
/* Sets pin code to string pin, disabled if using 'disable' as pin */
void set_pin_code(char *pin)
|
|
From: Peter K. <pk...@us...> - 2001-06-08 09:44:59
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_misc.c 1.10 1.11=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* Close file descriptors in open_socket() and open_tcpsocket()
as appropriate.
* Added error handling to open_socket() and open_tcpsocket().
* Improved some log messages.
* Marked debug messages as such.
The diff of the modified file(s):
--- bt_misc.c 2001/05/17 10:22:04 1.10
+++ bt_misc.c 2001/06/08 09:44:58 1.11
@@ -65,93 +65,109 @@
#include "btd.h"
#include "bt_misc.h"
=20
-int write_pidfile(char *pidname)
+#define D(x) //x
+
+int
+write_pidfile(const char *pidname)
{
int pid_fd;
char pid_buf[80];
=20
- if ((pid_fd =3D open(pidname, O_CREAT | O_WRONLY |=20
- O_TRUNC | O_EXCL, 0666)) < 0)
+ if ((pid_fd =3D open(pidname, O_CREAT | O_WRONLY | O_TRUNC | O_EXCL, 066=
6)) < 0)
{
if (errno =3D=3D EEXIST)
{
- syslog(LOG_INFO, "There is already another version of %s running.\n",
+ syslog(LOG_INFO, "There is already another version of %s running.",
pidname);
}
else
{
- syslog(LOG_INFO, "Could not create pid file for btinit.\n");
+ syslog(LOG_INFO, "Could not create pid file for btinit.");
}
exit(0);
}
=20
sprintf(pid_buf, "%d\n", getpid());
write(pid_fd, pid_buf, strlen(pid_buf));
- /* do not set pid_fd to -1, we use it to mark that we created the pid fi=
le */
close(pid_fd);
+
return pid_fd;
}
=20
-/* Local UNIX socket stuff */
-int open_socket(char *name, int role)
+/* Local UNIX socket */
+int
+open_socket(const char *name, int role)
{
- int server_sockfd;
struct sockaddr_un server_address;
- int client_sockfd;
- struct sockaddr_un client_address;
- int server_len;
- int client_len;=20=20
+ int fd;
=20
- syslog(LOG_INFO, "Opening socket %s ", name);
+ D(syslog(LOG_INFO, "Opening socket %s", name));
+
if (role =3D=3D SERVER)
{
/* remove any old socket */
unlink(name);
-=20=20=20=20
- /* open socket */=20=20=20=20
- server_sockfd =3D socket(AF_UNIX, SOCK_STREAM, 0);
- server_address.sun_family =3D AF_UNIX;
- strcpy(server_address.sun_path, name);
- server_len =3D sizeof(server_address);
- bind(server_sockfd, (struct sockaddr *)&server_address, server_len);
- listen(server_sockfd, 5);
- client_sockfd =3D accept(server_sockfd,=20
- (struct sockaddr *)&(client_address),
- &client_len);
}
- else
+=20=20=20=20
+ if ((fd =3D socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
{
- /* Client */
- client_sockfd =3D socket(AF_UNIX, SOCK_STREAM, 0);
+ syslog(LOG_ERR, __FUNCTION__ ": Failed to create %s", name);
+ return -1;
+ }
=20
- /* 'destination' socket */
+ memset(&server_address, 0, sizeof server_address);
server_address.sun_family =3D AF_UNIX;
strcpy(server_address.sun_path, name);
- server_len =3D sizeof(server_address);
=20=20=20=20=20=20=20
- if (connect(client_sockfd,=20
- (struct sockaddr *)&server_address,=20
- server_len) < 0) {
- syslog(LOG_ERR, "open_socket %s failed", name);
+ if (role =3D=3D SERVER)
+ {
+ int tmp_fd;
+
+ if (bind(fd, (struct sockaddr *)&server_address, sizeof server_address=
) < 0)
+ {
+ syslog(LOG_ERR, __FUNCTION__ ": Failed to bind %s", name);
+ close(fd);
return -1;
}
=20
- syslog(LOG_INFO, "Socket connected to %s\n", server_address.sun_path);
+ if (listen(fd, 5) < 0)
+ {
+ syslog(LOG_ERR, __FUNCTION__ ": Failed to listen on %s", name);
+ close(fd);
+ return -1;
}
=20
- return client_sockfd;
+ if ((tmp_fd =3D accept(fd, NULL, NULL)) < 0)
+ {
+ syslog(LOG_ERR, __FUNCTION__ ": Failed to accept %s", name);
+ close(fd);
+ return -1;
}
=20
+ close(fd);
+ fd =3D tmp_fd;
+ }
+ else
+ {
+ if (connect(fd, (struct sockaddr *)&server_address, sizeof server_addr=
ess) < 0)
+ {
+ syslog(LOG_ERR, __FUNCTION__ ": Failed to connect %s", name);
+ close(fd);
+ return -1;
+ }
+ }
+
+ D(syslog(LOG_INFO, "Socket connected to %s", name));
+
+ return fd;
+}
+
/* TCP socket */
-int open_tcpsocket(char *addrstr, int role)
+int
+open_tcpsocket(const char *addrstr, int role)
{
- int server_sockfd;
struct sockaddr_in server_address;
- int client_sockfd;
- struct sockaddr_in client_address;
-
- int server_len;
- int client_len;
+ int fd;
int port;
char ipstr[16];
char *pos;=20=20
@@ -161,7 +177,7 @@
if (!(pos =3D strchr(addrstr, ':')))
{
fprintf(stderr, "Port argument missing!\n");
- exit(1);
+ return -1;
}
=20
/* copy ip address */
@@ -172,67 +188,74 @@
/* extract port number */
port =3D atoi(pos+1);
=20
- if (role =3D=3D SERVER)
- {
/* open socket */=20=20=20=20
- server_sockfd =3D socket(AF_INET, SOCK_STREAM, 0);
+ if ((fd =3D socket(AF_INET, SOCK_STREAM, 0)) < 0)
+ {
+ syslog(LOG_ERR, __FUNCTION__ ": Failed to create socket");
+ return -1;
+ }
+
+ memset(&server_address, 0, sizeof server_address);
server_address.sin_family =3D AF_INET;
+ server_address.sin_port =3D htons(port);
=20
+ if (role =3D=3D SERVER)
+ {
+ int tmp_fd;
+
server_address.sin_addr.s_addr =3D htonl(INADDR_ANY);
- server_address.sin_port =3D htons(port);
=20
- server_len =3D sizeof(server_address);
+ if (bind(fd, (struct sockaddr *)&server_address, sizeof server_address=
) < 0)
+ {
+ syslog(LOG_ERR, __FUNCTION__ ": Failed to bind to port %d", port);
+ close(fd);
+ return -1;
+ }
=20
- if (bind(server_sockfd, (struct sockaddr *)&server_address, server_len=
))
+ if (listen(fd, 5) < 0)
{
- perror("bind");
- exit(1);
+ syslog(LOG_ERR, __FUNCTION__ ": Failed to listen to port %d", port);
+ close(fd);
+ return -1;
}
=20
- printf("Waiting for connect on port %d\n", port);
+ D(syslog(LOG_INFO, "Waiting for connection on port %d", port));
=20
- if (listen(server_sockfd, 5))
+ /* request for a new connection */
+ if ((tmp_fd =3D accept(fd, NULL, NULL)) < 0)
{
- perror("listen");
- exit(1);
+ syslog(LOG_ERR, __FUNCTION__ ": Failed to accept on port %d", port);
+ close(fd);
+ return -1;
}
=20=20=20=20=20
- /* request for a new connection */
- client_sockfd =3D accept(server_sockfd,
- (struct sockaddr *)&(client_address),
- &client_len);
+ close(fd);
+ fd =3D tmp_fd;
}
else
{
- /* Client */
-
- printf("Connecting to TCP server socket [%s:%d]\n", ipstr, port);
-=20=20=20=20
- /* open socket */=20=20=20=20
- client_sockfd =3D socket(AF_INET, SOCK_STREAM, 0);
+ D(syslog(LOG_INFO, "Connecting to %s:%d", ipstr, port));
=20
/* destination address */
- server_address.sin_family =3D AF_INET;
server_address.sin_addr.s_addr =3D inet_addr(ipstr);
- server_address.sin_port =3D htons(port); /* for example... */
- server_len =3D sizeof(server_address);
=20=20
- if (connect(client_sockfd,=20
- (struct sockaddr *)&server_address,=20
- server_len) < 0) {
- perror("open_tcpsocket");
- exit(1);
+ if (connect(fd, (struct sockaddr *)&server_address, sizeof server_addr=
ess) < 0)
+ {
+ syslog(LOG_ERR, __FUNCTION__ ": Failed to connect to %s:%d", ipstr, =
port);
+ close(fd);
+ return -1;
}
}
=20
- return client_sockfd;
+ return fd;
}
=20
=20
/*=20
* Retrieve the numerical IP address of eth0 for now.
*/
-char * get_local_ip_address(void)
+char *
+get_local_ip_address(void)
{
int fd;
struct ifreq ifr;
@@ -240,14 +263,14 @@
=20
if ((fd =3D socket(AF_INET, SOCK_DGRAM, 0)) < 0)
{
- syslog(LOG_INFO, "Could not determine local IP address!");
+ syslog(LOG_ERR, __FUNCTION__ ": Failed to create socket");
return "0.0.0.0";
}
=20=20=20
strcpy(ifr.ifr_name, "eth0");
if (ioctl(fd, SIOCGIFADDR, (int)&ifr) < 0)
{
- syslog(LOG_INFO, "Could not determine local IP address!");
+ syslog(LOG_INFO, __FUNCTION__ ": Could not determine local IP address!=
");
close(fd);
return "0.0.0.0";
}
@@ -345,7 +368,8 @@
return;
}
=20
-const char* bd2str(const unsigned char *bd)
+const char*
+bd2str(const unsigned char *bd)
{
static char buf[20];
=20
@@ -357,7 +381,7 @@
=20
#ifndef BT_USERSTACK
void=20
-print_data(const char *message, unsigned char *buf, int len)
+print_data(const char *message, const unsigned char *buf, int len)
{=20
int t;
=20
@@ -373,7 +397,8 @@
#endif
=20
/* Sets pin code to string pin, disabled if using 'disable' as pin */
-void set_pin_code(char *pin)
+void
+set_pin_code(const char *pin)
{
#ifdef __CRIS__
char exec_pinstr[100];
|
|
From: Peter K. <pk...@us...> - 2001-08-17 16:23:52
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_misc.c 1.11 1.12=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Need to set ifr.ifr_addr.sa_family before calling the SIOCGIFADDR ioctl
The diff of the modified file(s):
--- bt_misc.c 2001/06/08 09:44:58 1.11
+++ bt_misc.c 2001/08/17 16:23:21 1.12
@@ -267,6 +267,7 @@
return "0.0.0.0";
}
=20=20=20
+ ifr.ifr_addr.sa_family =3D AF_INET;
strcpy(ifr.ifr_name, "eth0");
if (ioctl(fd, SIOCGIFADDR, (int)&ifr) < 0)
{
|
|
From: Peter K. <pk...@us...> - 2001-08-29 08:34:44
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_misc.c 1.12 1.13=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Rewrote print_data() to handle a NULL message.
The diff of the modified file(s):
--- bt_misc.c 2001/08/17 16:23:21 1.12
+++ bt_misc.c 2001/08/29 08:34:43 1.13
@@ -384,16 +384,22 @@
void=20
print_data(const char *message, const unsigned char *buf, int len)
{=20
- int t;
+ int t =3D 0;
=20
- printf("\n%s (%d)", message, len);
- for (t =3D 0; t < len; t++)=20
+ if (message)
+ {
+ printf("\n%s (%d):\n", message, len);
+ }
+ while (t < len)
{
+ printf("0x%02x ", (uint)buf[t++]);
if(!(t % 16))
printf("\n ");
- printf("0x%02x ", (uint)buf[t]);
}
+ if (t && (t % 16))
+ {
printf("\n");
+ }
}
#endif
=20
|
|
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
|
|
From: Peter K. <pk...@us...> - 2001-10-04 13:09:47
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_misc.c 1.17 1.18=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Do not fail if TIOCGSERIAL ioctl does not work.
The diff of the modified file(s):
--- bt_misc.c 2001/10/04 10:04:07 1.17
+++ bt_misc.c 2001/10/04 13:09:46 1.18
@@ -334,6 +334,7 @@
unsigned long baudbase =3D atol(speedstr);
unsigned long speed =3D baudbase;
struct serial_struct serial;
+ int got_serial =3D 0;
=20
if (fd < 0)
{
@@ -357,11 +358,9 @@
exit(1);
}
=20
- if (ioctl(fd, TIOCGSERIAL, &serial))
+ if (ioctl(fd, TIOCGSERIAL, &serial) >=3D 0)
{
- perror("Error getting serial_struct with TIOCGSERIAL");
- exit(1);
- }
+ got_serial =3D 1;
=20=20=20=20=20
if (divisor)
{
@@ -375,6 +374,7 @@
/* Remove special baudrate */=20
serial.flags &=3D ~ASYNC_SPD_CUST;
}
+ }
=20=20=20=20=20
cfmakeraw(&t);
=20=09
@@ -403,7 +403,7 @@
exit(1);
}
=20
- if (ioctl(fd, TIOCSSERIAL, &serial))
+ if (got_serial && ioctl(fd, TIOCSSERIAL, &serial) < 0)
{
perror("Error setting serial_struct with TIOCSSERIAL");
}
|
|
From: Peter K. <pk...@us...> - 2001-10-04 15:03:20
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_misc.c 1.18 1.19=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Removed unnecessary return.
The diff of the modified file(s):
--- bt_misc.c 2001/10/04 13:09:46 1.18
+++ bt_misc.c 2001/10/04 15:03:19 1.19
@@ -407,8 +407,6 @@
{
perror("Error setting serial_struct with TIOCSSERIAL");
}
-
- return;
}
=20
unsigned long
|
|
From: Peter K. <pk...@us...> - 2001-10-04 15:10:40
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_misc.c 1.19 1.20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Fail again if a divisor is specified, but TIOCGSERIAL does not work.
The diff of the modified file(s):
--- bt_misc.c 2001/10/04 15:03:19 1.19
+++ bt_misc.c 2001/10/04 15:10:40 1.20
@@ -350,7 +350,11 @@
if (divisorp)
{
divisor =3D atol(divisorp+1);
+ if (!divisor) /* Just to be safe */
+ {
+ divisor =3D 1;
}
+ }
=20
if (tcgetattr(fd, &t) < 0)
{=20=20
@@ -375,6 +379,11 @@
serial.flags &=3D ~ASYNC_SPD_CUST;
}
}
+ else if (divisor)
+ {
+ perror("Error getting serial_struct with TIOCGSERIAL");
+ exit(1);
+ }
=20=20=20=20=20
cfmakeraw(&t);
=20=09
@@ -419,7 +428,7 @@
if (divisorp)
{
divisor =3D atol(divisorp+1);
- if (divisor =3D=3D 0) /* Just to be safe */
+ if (!divisor) /* Just to be safe */
{
divisor =3D 1;
}
|
|
From: Peter K. <pk...@us...> - 2001-10-16 14:43:19
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_misc.c 1.21 1.22=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Added #ifdefs around speeds above 115200 in translate_speed().
The diff of the modified file(s):
--- bt_misc.c 2001/10/10 16:20:40 1.21
+++ bt_misc.c 2001/10/16 10:25:36 1.22
@@ -337,15 +337,21 @@
case 115200:
speed_c =3D B115200;
break;
+#ifdef B230400
case 230400:
speed_c =3D B230400;
break;
+#endif
+#ifdef B460800
case 460800:
speed_c =3D B460800;
break;
+#endif
+#ifdef B921600
case 921600:
speed_c =3D B921600;
break;
+#endif
=20
default:
printf("Bad baudrate %d.\n", spd);
|