Fix building on musl libc
PATCH 1/1 Fix building on musl libc
From: Kylie McClain <[email protected]>
- Silence warnings:
errno.h is defined by POSIX, sys/errno.h is a glibcism, same with fcntl.h vs. sys/fcntl.h
- Use standard types rather than _GNU_SOURCE-exposed types u_int16_t -> uint16_t
u_int8_t -> uint8_t
--- brctl/brctl.c | 2 +- libbridge/libbridge.h | 13 +++++++------ libbridge/libbridge_devif.c | 2 +- libbridge/libbridge_if.c | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-)
brctl/brctl.c +1 -1
@@ -19,7 +19,7 @@#include <stdio.h> #include <stdlib.h> #include <string.h> -#include <sys/errno.h> +#include <errno.h> #include <getopt.h> #include "libbridge.h"
libbridge/libbridge.h +7 -6
@@ -19,6 +19,7 @@#ifndef _LIBBRIDGE_H#define _LIBBRIDGE_H +#include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <linux/if.h>
@@ -46,7 +47,7 @@ struct bridge_infostruct timeval bridge_max_age;struct timeval bridge_hello_time;struct timeval bridge_forward_delay; -u_int16_t root_port; +uint16_t root_port;unsigned char stp_enabled;unsigned char topology_change;unsigned char topology_change_detected;
@@ -59,8 +60,8 @@ struct bridge_infostruct fdb_entry { -u_int8_t mac_addr[6 ]; -u_int16_t port_no; +uint8_t mac_addr[6 ]; +uint16_t port_no;unsigned char is_local;struct timeval ageing_timer_value; };
@@ -70,9 +71,9 @@ struct port_infounsigned port_no;struct bridge_id designated_root;struct bridge_id designated_bridge; -u_int16_t port_id; -u_int16_t designated_port; -u_int8_t priority; +uint16_t port_id; +uint16_t designated_port; +uint8_t priority;unsigned char top_change_ack;unsigned char config_pending;unsigned char state;
libbridge/libbridge_devif.c +1 -1
@@ -23,7 +23,7 @@#include <errno.h> #include <string.h> #include <dirent.h> -#include <sys/fcntl.h> +#include <fcntl.h> #include "libbridge.h" #include "libbridge_private.h"
libbridge/libbridge_if.c +1 -1
@@ -20,7 +20,7 @@#include <stdlib.h> #include <errno.h> #include <string.h> -#include <sys/fcntl.h> +#include <fcntl.h> #include <sys/ioctl.h> #include "libbridge.h"
Signature · 1 line
2.9.0
Stephen Hemminger
AppliedQuoted 8 lines · On Wed, 22 Jun 2016 22:50:36 -0400 Kylie McClain <[email protected]>…
From: Kylie McClain <[email protected]>
- Silence warnings:
errno.his defined by POSIX,sys/errno.his a glibcism, same withfcntl.hvs.sys/fcntl.h
- Use standard types rather than _GNU_SOURCE-exposed typesu_int16_t->uint16_t
u_int8_t->uint8_t
Quoted 7 lines
--- brctl/brctl.c | 2 +- libbridge/libbridge.h | 13 +++++++------ libbridge/libbridge_devif.c | 2 +- libbridge/libbridge_if.c | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-)
Applied to git tree, but won't be spinning a new release anytime soon.