Re: Bug#531950: attr: FTBFS on GNU/kFreeBSD

Aurelien Jarno
2009-06-15T10:05:49Z

On Mon, Jun 15, 2009 at 12:26:12PM +0200, Petr Salinger wrote:
>> On Sun, Jun 14, 2009 at 10:56:28PM +0200, Aurelien Jarno wrote:
>>> Would such a patch be accepted more easily than the ENODATA patch?
>>
>> I don't think it's an except but in addition. Wherever we do a strerror
>> in the attr code we will have to special case ENODATA on Linux and only
>> there. Independent of that I think we would better of using the raw
>> syscalls in platforms already using binary namespaces rather than double
>> translation. Note that this is only applicable for the IRIX-heritage
>> attr_* routines exports by libattr, not the *xattr routines it also
>> exports.
>
> We would really appreciate to have either "#ifdef ENODATA" or
> "#ifdef __linux__" applied to current debian version of package.
> The debian maintainer does not want to diverge from (future) upstream,
> which is quite understandable.
>

> Would be possible to special case ENODATA as 1st step and postpone
> adding of syscall support later ?

Fully agreed.

Please find below the __linux_ version of the patch.

--- attr-2.4.43.orig/getfattr/getfattr.c
+++ attr-2.4.43/getfattr/getfattr.c
@@ -93,8 +93,10 @@

const char *strerror_ea(int err)
{
+#ifdef __linux__
if (err == ENODATA)
return _("No such attribute");
+#endif
return strerror(err);
}

only in patch2:
unchanged:
--- attr-2.4.43.orig/setfattr/setfattr.c
+++ attr-2.4.43/setfattr/setfattr.c
@@ -66,8 +66,10 @@

const char *strerror_ea(int err)
{
+#ifdef __linux__
if (err == ENODATA)
return _("No such attribute");
+#endif
return strerror(err);
}

--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net