svn commit: trunk/buildroot/package/sfdisk
Author: nkukard
Date: 2008-04-17 06:23:20 -0700 (Thu, 17 Apr 2008) New Revision: 21754
Log:
* Fix _llseek not being defined in some cases
* Add index & rindex defines if they're not defined either (legacy susv4 functions)
Added:
trunk/buildroot/package/sfdisk/sfdisk.005.no-llseek-fix.patch trunk/buildroot/package/sfdisk/sfdisk.010.index-rindex-fix.patch
Changeset:
Added: trunk/buildroot/package/sfdisk/sfdisk.005.no-llseek-fix.patch
===================================================================
buildroot/package/sfdisk/sfdisk.005.no-llseek-fix.patch +21 -0
@@ -0,0 +1,21 @@ +diff -ur sfdisk_vanilla/sfdisk.c sfdisk_llseek-fix/sfdisk.c +--- sfdisk_vanilla/sfdisk.c 2004-01-13 13:03:11.000000000 +0000 ++++ sfdisk_llseek-fix/sfdisk.c 2008-04-17 08:42:35.000000000 +0000 +@@ -134,9 +137,17 @@ + * Note: we use 512-byte sectors here, irrespective of the hardware ss. + */ + #if defined(__linux__) && !defined (__alpha__) && !defined (__ia64__) && !defined (__x86_64__) && !defined (__s390x__) ++#if defined(_llseek) + static + _syscall5(int, _llseek, unsigned int, fd, ulong, hi, ulong, lo, + loff_t *, res, unsigned int, wh); ++#else ++static int _llseek (unsigned int fd, unsigned long oh, ++ unsigned long ol, long long *result, ++ unsigned int origin) { ++ return syscall (__NR__llseek, fd, oh, ol, result, origin); ++#endif ++} + #endif + + static int
Added: trunk/buildroot/package/sfdisk/sfdisk.010.index-rindex-fix.patch
===================================================================
buildroot/package/sfdisk/sfdisk.010.index-rindex-fix.patch +21 -0
@@ -0,0 +1,21 @@ +diff -ru sfdisk_llseek-fix/sfdisk.c sfdisk_index-rindex-fix/sfdisk.c +--- sfdisk_llseek-fix/sfdisk.c 2008-04-17 08:42:35.000000000 +0000 ++++ sfdisk_index-rindex-fix/sfdisk.c 2008-04-17 09:50:17.000000000 +0000 +@@ -58,6 +58,17 @@ + + #define SIZE(a) (sizeof(a)/sizeof(a[0])) + ++/* ++ * Why these wouldn't be defined in string.h, I don't know, there is a block ++ * testing for BSD, and no other mention of these functions ... NK ++ */ ++#if !defined(index) ++# define index(s,c) strchr((s), (c)) ++#endif ++#if !defined(rindex) ++# define rindex(s,c) strrchr((s), (c)) ++#endif ++ + /* + * Table of contents: + * A. About seeking
Quoted 4 lines · nkukard at uclibc.org
Author: nkukard
Date: 2008-04-17 06:23:20 -0700 (Thu, 17 Apr 2008) New Revision: 21754
Quoted 9 lines
Log:
* Fix_llseeknot being defined in some cases
* Add index & rindex defines if they're not defined either (legacy susv4 functions)Added:
trunk/buildroot/package/sfdisk/sfdisk.005.no-llseek-fix.patchtrunk/buildroot/package/sfdisk/sfdisk.010.index-rindex-fix.patch
Please revert the index/rindex patch. You should be patching the code to NOT use those functions, not define them again. Remove the usage of them and then submit a patch to the upstream maintainer of sfdisk.
-Steve
<snip>
Quoted 5 lines
Quoted 2 lines
trunk/buildroot/package/sfdisk/sfdisk.010.index-rindex-fix.patchPlease revert the index/rindex patch. You should be patching the code to NOT use those functions, not define them again. Remove the usage of them and then submit a patch to the upstream maintainer of sfdisk.
done
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://busybox.net/lists/buildroot/attachments/20080417/e18941c0/attachment.pgp
Quoted 11 lines
Quoted 8 lines
* Add index & rindex defines if they're not defined either (legacy susv4 functions)
Added:
trunk/buildroot/package/sfdisk/sfdisk.005.no-llseek-fix.patchtrunk/buildroot/package/sfdisk/sfdisk.010.index-rindex-fix.patchPlease revert the index/rindex patch. You should be patching the code to NOT use those functions, not define them again. Remove the usage of them and then submit a patch to the upstream maintainer of sfdisk.
You probably already submitted your patch util-linux-remove-deprecated-functions.patch upstream, which I just saw fixes the same problem. sfdisk appears to be from util-linux, which is also included under the package dir, which I just added a patch for which fixes the index/rindex issue and doesnt hide it.
-N
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://busybox.net/lists/buildroot/attachments/20080417/53047c3f/attachment.pgp