Re: [systemd-devel] [RFC 13/25] shared/missing.h: check for missing strndupa

2014-09-18 Thread Cristian Rodríguez
El 18/09/14 a las #4, Emil Renner Berthing escribió: +#if !HAVE_DECL_STRNDUPA +#define strndupa(s, n) \ + ({ \ +const char *__old = (s); \ +size_t __len = strnlen(__old, (n)); \ +char *__new = (char *)alloca(__len + 1); \ +__new[__len] = '\0'; \ +(char *)memcpy(__new, __old,

[systemd-devel] [RFC 13/25] shared/missing.h: check for missing strndupa

2014-09-18 Thread Emil Renner Berthing
--- configure.ac | 3 ++- src/shared/missing.h | 11 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 1f2bbd0..3db0e24 100644 --- a/configure.ac +++ b/configure.ac @@ -301,9 +301,10 @@ LIBS="$save_LIBS" AC_CHECK_FUNCS([fanotif