diff mbox series

[2/2] Fix compilation on FreeBSD broken by strdupa usage

Message ID 20181018130628.17133-2-christian.storm@siemens.com
State Accepted
Headers show
Series [1/2] Fix compilation on FreeBSD broken by __u64 usage | expand

Commit Message

Storm, Christian Oct. 18, 2018, 1:06 p.m. UTC
Like strndupa() already in compat.h, strdupa() is not
defined on the BSDs. Commit 62476e3 makes use of it
and hence broke builds on FreeBSD.

Signed-off-by: Christian Storm <christian.storm@siemens.com>
---
 include/compat.h | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Stefano Babic Oct. 22, 2018, 4:27 p.m. UTC | #1
On 18/10/18 15:06, Christian Storm wrote:
> Like strndupa() already in compat.h, strdupa() is not
> defined on the BSDs. Commit 62476e3 makes use of it
> and hence broke builds on FreeBSD.
> 
> Signed-off-by: Christian Storm <christian.storm@siemens.com>
> ---
>  include/compat.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/include/compat.h b/include/compat.h
> index 8bbce90..3f69dfb 100644
> --- a/include/compat.h
> +++ b/include/compat.h
> @@ -23,6 +23,10 @@
>  	}))
>  #endif
>  
> +#ifndef strdupa
> +#define strdupa(s) strndupa(s, strlen(s))
> +#endif
> +
>  #if defined(__FreeBSD__)
>  /*
>   * Define ENODATA (61 - No data available) to
> 

Applied to -master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/include/compat.h b/include/compat.h
index 8bbce90..3f69dfb 100644
--- a/include/compat.h
+++ b/include/compat.h
@@ -23,6 +23,10 @@ 
 	}))
 #endif
 
+#ifndef strdupa
+#define strdupa(s) strndupa(s, strlen(s))
+#endif
+
 #if defined(__FreeBSD__)
 /*
  * Define ENODATA (61 - No data available) to