[oe-commits] Khem Raj : tgt_1.0.12.bb: Fix build on uclibc

git version control git at git.openembedded.org
Sun Jan 16 00:42:35 UTC 2011


Module: openembedded.git
Branch: master
Commit: 992b4de5896e01316d315a7aef57e7c0ed0aca7b
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=992b4de5896e01316d315a7aef57e7c0ed0aca7b

Author: Khem Raj <raj.khem at gmail.com>
Date:   Sat Jan 15 16:37:19 2011 -0800

tgt_1.0.12.bb: Fix build on uclibc

* Uclibc does not provide posix_fallocate so use ftruncate

Signed-off-by: Khem Raj <raj.khem at gmail.com>

---

 .../tgt/tgt-1.0.12/use-ftruncate-on-uclibc.patch   |   18 ++++++++++++++++++
 recipes/tgt/tgt_1.0.12.bb                          |    6 ++++--
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/recipes/tgt/tgt-1.0.12/use-ftruncate-on-uclibc.patch b/recipes/tgt/tgt-1.0.12/use-ftruncate-on-uclibc.patch
new file mode 100644
index 0000000..e9b6e38
--- /dev/null
+++ b/recipes/tgt/tgt-1.0.12/use-ftruncate-on-uclibc.patch
@@ -0,0 +1,18 @@
+Index: tgt-1.0.12/usr/tgtimg.c
+===================================================================
+--- tgt-1.0.12.orig/usr/tgtimg.c	2011-01-15 16:28:30.488656000 -0800
++++ tgt-1.0.12/usr/tgtimg.c	2011-01-15 16:35:14.958656001 -0800
+@@ -438,8 +438,13 @@
+ 			perror("Failed creating file");
+ 			exit(2);
+ 		}
++#ifndef __UCLIBC__
+ 		if (posix_fallocate(fd, 0, size*1024*1024LL) == -1) {
+ 			perror("posix_fallocate failed.");
++#else
++		if (ftruncate (fd, size*1024*1024LL) == -1) {
++			perror("ftruncate failed.");
++#endif
+ 			exit(3);
+ 		}
+ 
diff --git a/recipes/tgt/tgt_1.0.12.bb b/recipes/tgt/tgt_1.0.12.bb
index abba317..0288b16 100644
--- a/recipes/tgt/tgt_1.0.12.bb
+++ b/recipes/tgt/tgt_1.0.12.bb
@@ -3,9 +3,11 @@ HOMEPAGE = "http://stgt.berlios.de/"
 LICENSE = "GPLv2"
 DEPENDS = "openssl"
 RDEPENDS_${PN} = "iscsi-target"
-PR = "r0"
+PR = "r1"
 
-SRC_URI = "http://stgt.berlios.de/releases/tgt-${PV}.tar.gz"
+SRC_URI = "http://stgt.berlios.de/releases/tgt-${PV}.tar.gz \
+	   file://use-ftruncate-on-uclibc.patch \
+	  "
 SRC_URI[md5sum] = "d3bc4098d0ec6f4418e574ea7fdd18eb"
 SRC_URI[sha256sum] = "4d90567997e16194b86cc3ab0a55c7aa5c5054681176b60c6635b20a1feaffe2"
 





More information about the Openembedded-commits mailing list