Browse Source

tgt: fix musl compatibility

 - Include `sys/user.h` if `__WORDSIZE` is undefined
 - Add `fcntl.h` to `libscc.c` in order to declare `loff_t`

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Jo-Philipp Wich 9 years ago
parent
commit
e55822ec2b
2 changed files with 38 additions and 2 deletions
  1. 2
    2
      net/tgt/Makefile
  2. 36
    0
      net/tgt/patches/100-musl-compat.patch

+ 2
- 2
net/tgt/Makefile View File

@@ -1,5 +1,5 @@
1 1
 #
2
-# Copyright (C) 2012-2014 OpenWrt.org
2
+# Copyright (C) 2012-2015 OpenWrt.org
3 3
 #
4 4
 # This is free software, licensed under the GNU General Public License v2.
5 5
 # See /LICENSE for more information.
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
9 9
 PKG_NAME:=tgt
10 10
 PKG_VERSION:=1.0.53
11 11
 PKG_REV:=9764e0afd9a7115e356fc85569a780f9003c4eac
12
-PKG_RELEASE:=3
12
+PKG_RELEASE:=4
13 13
 PKG_USE_MIPS16:=0
14 14
 
15 15
 PKG_SOURCE_PROTO:=git

+ 36
- 0
net/tgt/patches/100-musl-compat.patch View File

@@ -0,0 +1,36 @@
1
+--- a/usr/tgtd.h
2
++++ b/usr/tgtd.h
3
+@@ -9,6 +9,10 @@
4
+ #include <systemd/sd-daemon.h>
5
+ #endif
6
+ 
7
++#ifndef __WORDSIZE
8
++#include <sys/user.h>
9
++#endif
10
++
11
+ struct concat_buf;
12
+ 
13
+ #define NR_SCSI_OPCODES		256
14
+--- a/usr/util.h
15
++++ b/usr/util.h
16
+@@ -16,6 +16,10 @@
17
+ #include <limits.h>
18
+ #include <linux/types.h>
19
+ 
20
++#ifndef __WORDSIZE
21
++#include <sys/user.h>
22
++#endif
23
++
24
+ #include "be_byteshift.h"
25
+ 
26
+ #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
27
+--- a/usr/libssc.c
28
++++ b/usr/libssc.c
29
+@@ -23,6 +23,7 @@
30
+ #include <string.h>
31
+ #include <unistd.h>
32
+ #include <stdio.h>
33
++#include <fcntl.h>
34
+ #include "bs_ssc.h"
35
+ #include "ssc.h"
36
+ #include "be_byteshift.h"