[Libwebsockets] recent changes breaking DomTerm

Per Bothner per at bothner.com
Thu Jan 25 02:48:55 CET 2018


On 01/24/2018 05:05 PM, Andy Green wrote:
> I can reproduce this with your latest DomTerm... one quirk though my platform needed:
> 
> diff --git a/lws-term/commands.c b/lws-term/commands.c
> index 6efbb8c..d525f2c 100644
> --- a/lws-term/commands.c
> +++ b/lws-term/commands.c
> @@ -1,7 +1,7 @@
>   #include "server.h"
>   #include "version.h"
>   #include <stdlib.h>
> -#include <magic.h>
> +#include <linux/magic.h>
>   #include <sys/mman.h>
>   #include <sys/stat.h>

That gets the wrong include file, at least on Fedora.
There are two different files:

/usr/include/linux/magic.h
   - various filesystem and other OS-level magic numbers

/usr/include/magic.h
   - definitions for the "libmagic" user-level library,
     such as the function magic_open

commands.c uses the latter.

The correct fix (which I checked in) is:

#if HAVE_LIBMAGIC
#include <magic.h>
#endif

Hopefully that works.
-- 
	--Per Bothner
per at bothner.com   http://per.bothner.com/



More information about the Libwebsockets mailing list