mirror of
https://github.com/eddyem/eddys_snippets.git
synced 2026-03-20 08:41:02 +03:00
remove bug with sockets: write->send(..., MSG_NOSIGNAL)
This commit is contained in:
@@ -68,7 +68,7 @@ frame.can_dlc = 6;
|
||||
frame.can_id = 0xaa;
|
||||
const uint8_t d[] = {1, 2, 3, 4, 5, 6, 0, 0};
|
||||
memcpy(&frame.data, d, 8);
|
||||
int n = write(sock, &frame, sizeof(struct can_frame));
|
||||
int n = send(sock, &frame, sizeof(struct can_frame), MSG_NOSIGNAL);
|
||||
if(sizeof(struct can_frame) != n){
|
||||
printf("n=%d\n", n);
|
||||
WARN("write()");
|
||||
|
||||
Reference in New Issue
Block a user