diff mbox series

handlers: raw_handler: Fix FreeBSD build

Message ID 128E6DFF-09EC-426E-9F79-908A42B7DEF0@siemens.com
State Accepted
Headers show
Series handlers: raw_handler: Fix FreeBSD build | expand

Commit Message

Storm, Christian Jan. 15, 2025, 3:18 p.m. UTC
On FreeBSD, PATH_MAX is defined in sys/syslimits.h which is
included from limits.h. This in turn is already included, e.g.,
in core/swupdate.c, so don't explicitly do it here (again).

Still, the #ifdef enclosing Linux-specific linux/fs.h is required
for compilation on FreeBSD.

Signed-off-by: Christian Storm <christian.storm@siemens.com>
---
 handlers/raw_handler.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Stefano Babic Jan. 15, 2025, 4:39 p.m. UTC | #1
On 1/15/25 16:18, 'Storm, Christian' via swupdate wrote:
> On FreeBSD, PATH_MAX is defined in sys/syslimits.h which is
> included from limits.h. This in turn is already included, e.g.,
> in core/swupdate.c, so don't explicitly do it here (again).
>
> Still, the #ifdef enclosing Linux-specific linux/fs.h is required
> for compilation on FreeBSD.
>
> Signed-off-by: Christian Storm <christian.storm@siemens.com>
> ---
>   handlers/raw_handler.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/handlers/raw_handler.c b/handlers/raw_handler.c
> index 59a964a0..08912f18 100644
> --- a/handlers/raw_handler.c
> +++ b/handlers/raw_handler.c
> @@ -11,7 +11,9 @@
>   #include <unistd.h>
>   #include <errno.h>
>   #include <libgen.h>
> +#if defined(__linux__)
>   #include <linux/fs.h>
> +#endif
>
>   #include "swupdate_image.h"
>   #include "handler.h"

Applied to -master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/handlers/raw_handler.c b/handlers/raw_handler.c
index 59a964a0..08912f18 100644
--- a/handlers/raw_handler.c
+++ b/handlers/raw_handler.c
@@ -11,7 +11,9 @@ 
 #include <unistd.h>
 #include <errno.h>
 #include <libgen.h>
+#if defined(__linux__)
 #include <linux/fs.h>
+#endif
 
 #include "swupdate_image.h"
 #include "handler.h"