Browse Source

MT#55283 convert timestamping to bool

Change-Id: If87a80917396fa397e6d0641c38546bd31a10a31
pull/1910/head
Richard Fuchs 10 months ago
parent
commit
bf08339f5a
2 changed files with 5 additions and 5 deletions
  1. +4
    -4
      lib/socket.c
  2. +1
    -1
      lib/socket.h

+ 4
- 4
lib/socket.c View File

@ -27,7 +27,7 @@ static bool __ip_bind(socket_t *s, unsigned int, const sockaddr_t *);
static bool __ip_connect(socket_t *s, const endpoint_t *);
static bool __ip_listen(socket_t *s, int backlog);
static bool __ip_accept(socket_t *s, socket_t *new_sock);
static int __ip_timestamping(socket_t *s);
static bool __ip_timestamping(socket_t *s);
static int __ip4_pktinfo(socket_t *s);
static int __ip6_pktinfo(socket_t *s);
static bool __ip4_sockaddr2endpoint(endpoint_t *, const void *);
@ -410,11 +410,11 @@ static void __ip4_pmtu_disc(socket_t *s, int opt) {
if (setsockopt(s->fd, IPPROTO_IP, IP_MTU_DISCOVER, &opt, sizeof(opt)))
ilog(LOG_ERR, "Failed to set PMTU discovery option on IPv4 socket: %s", strerror(errno));
}
static int __ip_timestamping(socket_t *s) {
static bool __ip_timestamping(socket_t *s) {
int one = 1;
if (setsockopt(s->fd, SOL_SOCKET, SO_TIMESTAMP, &one, sizeof(one)))
return -1;
return 0;
return false;
return true;
}
static int __ip4_pktinfo(socket_t *s) {
int one = 1;


+ 1
- 1
lib/socket.h View File

@ -73,7 +73,7 @@ struct socket_family {
bool (*connect)(socket_t *, const endpoint_t *);
bool (*listen)(socket_t *, int);
bool (*accept)(socket_t *, socket_t *);
int (*timestamping)(socket_t *);
bool (*timestamping)(socket_t *);
int (*pktinfo)(socket_t *);
ssize_t (*recvfrom)(socket_t *, void *, size_t, endpoint_t *);
ssize_t (*recvfrom_ts)(socket_t *, void *, size_t, endpoint_t *, struct timeval *);


Loading…
Cancel
Save