|
From: Peter K. <pk...@us...> - 2001-05-31 12:18:39
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
btd.c 1.16 1.17=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Use sigsetjmp()/siglongjmp() instead of setjmp()/longjmp() as
we need to call siglongjmp() from a signal handler.
The diff of the modified file(s):
--- btd.c 2001/05/23 14:03:43 1.16
+++ btd.c 2001/05/31 12:18:38 1.17
@@ -179,7 +179,7 @@
static int sdpsrv_pid =3D 0;
static int bt_cfd =3D -1; /* control tty for bt stack */
static int phys_fd =3D -1; /* physical device e.g ttyS0 */
-static jmp_buf jmpbuffer; /* used to jump back in program after doing rese=
t */
+static sigjmp_buf jmpbuffer; /* used to jump back in program after doing r=
eset */
=20
=20
/* long option list */
@@ -267,7 +267,7 @@
}
=20=20=20
/* Set restart point */
- if (setjmp(jmpbuffer) !=3D 0)
+ if (sigsetjmp(jmpbuffer, 1) !=3D 0)
{
syslog(LOG_INFO, "restart...\n\n\n\n");
sleep(1);
@@ -345,11 +345,14 @@
=20=20=20=20=20=20=20
case -1:
{=20=20
+ if (errno !=3D EINTR)
+ {
/* Error */
perror("select");
=20
/* FIXME -- e.g if ipa server restarts !!! */
}
+ }
break;
=20=20=20=20=20=20=20
default:
@@ -363,8 +366,6 @@
/* IPA response */
if (FD_ISSET(ipa_fd, &rfd))
{
-=09=20=20=20=20
-=09=20=20=20=20
msg =3D (struct ipa_msg*) ipa_buf;
/* Got response from IPA, if ok then start pppd or modem emul =
*/
ipa_read(ipa_fd, msg);
@@ -692,16 +693,16 @@
{
/* Shutdown all and restart */
btd_cleanup();
- longjmp(jmpbuffer, 1);
+ siglongjmp(jmpbuffer, 1);
}
else if (sig =3D=3D SIGUSR2) /* ? */
{=20=20=20=20
/* Close down phys dev, run hw_upgrade and restart btd */
- btd_cleanup();
+// btd_cleanup();
=20=20
/* FIXME -- execvp(hw_upgrade_prog) */
=20=20=20=20=20
- longjmp(jmpbuffer, 1);
+// siglongjmp(jmpbuffer, 1);
}
else if (sig =3D=3D SIGTERM) /* ? */
{=20
|