|
From: Peter K. <pk...@us...> - 2001-04-17 18:09:16
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
btd.c 1.7 1.8=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* Do not add ipa_fd to the set of selected file descriptos if
USE_IPASSIGN is not defined.
* The --modem-emul (-m) option now has an effect again.
* Removed some unnecessary includes.
The diff of the modified file(s):
--- btd.c 2001/04/04 10:43:04 1.7
+++ btd.c 2001/04/17 18:09:15 1.8
@@ -81,26 +81,17 @@
=20
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - =
- */
=20
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <sys/wait.h>
-#include <sys/time.h>
-#include <fcntl.h>
-#include <time.h>
#include <stdio.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <termios.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
#include <syslog.h>
-#include <errno.h>
-#include <stdarg.h>
-#include <signal.h>
#include <getopt.h>
#include <setjmp.h>
-
-/* inet_ntoa */
+#include <termios.h>
+#include <sys/ioctl.h>
+#include <sys/wait.h>
#include <arpa/inet.h>
=20
#include "btd.h"
@@ -155,8 +146,8 @@
/* =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 */
/* IPA stuff */
=20
-static int ipa_fd =3D -1;
#ifdef USE_IPASSIGN
+static int ipa_fd =3D -1;
static struct ipa_msg *msg;
static unsigned char ipa_buf[256];
static int parse_ipa_response(struct ipa_msg *msg);
@@ -316,11 +307,12 @@
tv.tv_usec =3D 0;
=20
FD_ZERO(&rfd);=20=20
+#ifdef USE_IPASSIGN
FD_SET(ipa_fd, &rfd);
+#endif
FD_SET(0, &rfd);
=20
- result =3D select(FD_SETSIZE, &rfd, (fd_set*)0,=20
- (fd_set*)0, &tv);
+ result =3D select(FD_SETSIZE, &rfd, NULL, NULL, &tv);
switch (result)
{
case 0:
@@ -487,8 +479,7 @@
=20=20=20=20=20
get_local_addr(local_ip);
/* local/remote ip */
- sprintf(ip_addresses, "%s:%s", local_ip,=20
- inet_ntoa(ipset->ip));
+ sprintf(ip_addresses, "%s:%s", local_ip, inet_ntoa(ipset->ip));
=20=20=20=20=20
printf("IP used : %s\n", ip_addresses);
=20
@@ -602,9 +593,12 @@
=20=20=20=20=20=20=20
_exit(0);
}=20
+ else if (PEER(line).pppd_pid > 0)
+ {
syslog(LOG_INFO, "Started modem emulator on %s [pid : %d]",=20
dev, PEER(line).pppd_pid);=20
}
+ }
else
{
STATE(line) =3D PPPD_STARTED;
@@ -619,6 +613,10 @@
=20=20=20=20=20=20=20
_exit(0);
}=20
+ else if (PEER(line).pppd_pid > 0)
+ {
+ D(syslog(LOG_INFO, "Started pppd on %s [pid: %d]", dev, PEER(line).p=
ppd_pid));
+ }
}
=20=20=20
return 0;=20
@@ -743,7 +741,7 @@
{
PEER(i).state =3D NOCONNECTION;
PEER(i).pppd_pid =3D -1;
- PEER(i).do_modememul =3D 1; /* all enabled per default */
+ PEER(i).do_modememul =3D modem_emul;
PEER(i).ipset =3D NULL;
}=20=20
=20=20=20
|