Module Name: src Committed By: mlelstv Date: Sat Sep 7 13:57:25 UTC 2024
Modified Files: src/usr.sbin/bthcid: client.c hci.c Log Message: Don't get killed when peer vanishes. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/bthcid/client.c cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/bthcid/hci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.sbin/bthcid/client.c diff -u src/usr.sbin/bthcid/client.c:1.5 src/usr.sbin/bthcid/client.c:1.6 --- src/usr.sbin/bthcid/client.c:1.5 Tue Jan 10 20:56:41 2017 +++ src/usr.sbin/bthcid/client.c Sat Sep 7 13:57:25 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: client.c,v 1.5 2017/01/10 20:56:41 christos Exp $ */ +/* $NetBSD: client.c,v 1.6 2024/09/07 13:57:25 mlelstv Exp $ */ /*- * Copyright (c) 2006 Itronix Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: client.c,v 1.5 2017/01/10 20:56:41 christos Exp $"); +__RCSID("$NetBSD: client.c,v 1.6 2024/09/07 13:57:25 mlelstv Exp $"); #include <sys/ioctl.h> #include <sys/queue.h> @@ -268,7 +268,7 @@ send_client_request(bdaddr_t *laddr, bda cp.time = PIN_REQUEST_TIMEOUT; LIST_FOREACH(cl, &client_list, next) { - if (send(cl->fd, &cp, sizeof(cp), 0) != sizeof(cp)) + if (send(cl->fd, &cp, sizeof(cp), MSG_NOSIGNAL) != sizeof(cp)) syslog(LOG_ERR, "send PIN request failed"); else n++; Index: src/usr.sbin/bthcid/hci.c diff -u src/usr.sbin/bthcid/hci.c:1.3 src/usr.sbin/bthcid/hci.c:1.4 --- src/usr.sbin/bthcid/hci.c:1.3 Mon Oct 5 12:34:26 2009 +++ src/usr.sbin/bthcid/hci.c Sat Sep 7 13:57:25 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: hci.c,v 1.3 2009/10/05 12:34:26 plunky Exp $ */ +/* $NetBSD: hci.c,v 1.4 2024/09/07 13:57:25 mlelstv Exp $ */ /*- * Copyright (c) 2006 Itronix Inc. @@ -55,7 +55,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: hci.c,v 1.3 2009/10/05 12:34:26 plunky Exp $"); +__RCSID("$NetBSD: hci.c,v 1.4 2024/09/07 13:57:25 mlelstv Exp $"); #include <sys/ioctl.h> #include <sys/time.h> @@ -335,6 +335,6 @@ send_hci_cmd(int sock, struct sockaddr_b if (len > 0) memcpy(msg + sizeof(hci_cmd_hdr_t), buf, len); - return sendto(sock, msg, sizeof(hci_cmd_hdr_t) + len, 0, + return sendto(sock, msg, sizeof(hci_cmd_hdr_t) + len, MSG_NOSIGNAL, (struct sockaddr *)sa, sizeof(*sa)); }