Package: python-pyxattr
Version: 0.4.0-1
Severity: important
Tags: patch
User: debian-...@lists.debian.org
Usertags: kfreebsd

Hi,

ENODATA doesn't exist everywhere (e.g. not on GNU/kFreeBSD), so it'd be
nice if some #if defined() could be used. The attached patch is quite
awful, but hopefully, either you or upstream will find a better way to
handle it. ;)

,--[ 
https://buildd.debian.org/fetch.cgi?pkg=python-pyxattr&arch=kfreebsd-i386&ver=0.4.0-1&stamp=1246046553&file=log&as=raw
| gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall 
-Wstrict-prototypes -g -O2 -fPIC -D_XATTR_VERSION="0.4.0" 
-D_XATTR_AUTHOR="Iustin Pop" -D_XATTR_EMAIL="iu...@k1024.org" 
-I/usr/include/python2.4 -c xattr.c -o 
build/temp.gnukfreebsd-7.2-1-686-i686-2.4/xattr.o
| xattr.c: In function 'get_all':
| xattr.c:379: error: 'ENODATA' undeclared (first use in this function)
| xattr.c:379: error: (Each undeclared identifier is reported only once
| xattr.c:379: error: for each function it appears in.)
| error: command 'gcc' failed with exit status 1
`--

Thanks for considering.

Mraw,
KiBi.
--- python-pyxattr-0.4.0.orig/xattr.c
+++ python-pyxattr-0.4.0/xattr.c
@@ -376,11 +376,19 @@
                         goto free_list;
                     nalloc = nval;
                     continue;
-                } else if(errno == ENODATA || errno == ENOATTR) {
+                } else if(errno == ENOATTR) {
                     /* this attribute has gone away since we queried
                        the attribute list */
                     missing = 1;
                     break;
+#if defined(ENODATA)
+/* Same as the ENOATTR case, but some platforms don't have ENODATA. */
+                } else if(errno == ENODATA) {
+                    /* this attribute has gone away since we queried
+                       the attribute list */
+                    missing = 1;
+                    break;
+#endif
                 }
                 goto exit_errno;
             }

Reply via email to