bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] cp/mv: xattr support


From: Jim Meyering
Subject: Re: [PATCH] cp/mv: xattr support
Date: Sat, 15 Nov 2008 18:12:09 +0100

Kamil Dudka <address@hidden> wrote:
> New version of patch is attached...

Thanks.
I've attached a couple of simple changes that you
may merge into yours.

Then it looks like you can adjust your patch to check for, and use,
attr_copy_fd, rather than attr_copy_file.  The only reason we use
name-oriented interfaces (rather than fd-oriented ones) in copy.c
is when there is no fd-oriented analog.

Also, please avoid this warning (seen at least on rawhide):

  copy.c:160: warning: passing argument 4 of 'attr_copy_file' from incompatible 
pointer type

>From /usr/include/attr/libattr.h:

  extern int attr_copy_file (const char *, const char *,
                             int (*) (const char *, struct error_context *),
                             struct error_context *);
  extern int attr_copy_fd (const char *, int, const char *, int,
                           int (*) (const char *, struct error_context *),
                           struct error_context *);

When the above is fixed, maybe copy_attr_error will be gone.
If not, rewrite copy_attr_error not to use xmalloc (the comment
there is now false: you can use gnulib's verror module),
since copy.c is intended to be library-grade, when feasible.
Yes, there's one existing xmalloc use... it might be removed too,
some day.


Jim

>From 51f640bd6cb631219d48aa96c0ac3f6b714dd5d6 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sat, 15 Nov 2008 14:00:13 +0100
Subject: [PATCH] adjust copyright; split long lines

---
 m4/xattr.m4 |   27 +++++++++------------------
 1 files changed, 9 insertions(+), 18 deletions(-)

diff --git a/m4/xattr.m4 b/m4/xattr.m4
index 5e22a9c..1c1657a 100644
--- a/m4/xattr.m4
+++ b/m4/xattr.m4
@@ -1,20 +1,9 @@
 # xattr.m4 - check for Extended Attributes (Linux)

-# Copyright (C) 2003 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+# Copyright (C) 2003, 2008 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.

 # Originally written by Andreas Gruenbacher.
 # http://www.suse.de/~agruen/coreutils/5.91/coreutils-xattr.diff
@@ -22,7 +11,8 @@
 AC_DEFUN([gl_FUNC_XATTR],
 [
   AC_ARG_ENABLE([xattr],
-       AC_HELP_STRING([--disable-xattr], [turn off support for extended 
attributes]),
+       AC_HELP_STRING([--disable-xattr],
+                      [turn off support for extended attributes]),
        [use_xattr=$enableval], [use_xattr=yes])

   if test "$use_xattr" = "yes"; then
@@ -37,9 +27,10 @@ AC_DEFUN([gl_FUNC_XATTR],
                       [Define if you want extended attribute support.])
     xattr_saved_LIBS=$LIBS
     AC_SEARCH_LIBS([attr_copy_file], [attr],
-                  [test "$ac_cv_search_attr_copy_file" = "none required" || 
LIB_XATTR=$ac_cv_search_attr_copy_file])
-    AC_SUBST([LIB_XATTR])
+                  [test "$ac_cv_search_attr_copy_file" = "none required" ||
+                     LIB_XATTR=$ac_cv_search_attr_copy_file])
     AC_CHECK_FUNCS([attr_copy_file])
     LIBS=$xattr_saved_LIBS
+    AC_SUBST([LIB_XATTR])
   fi
 ])
--
1.6.0.4.983.ga2771




reply via email to

[Prev in Thread] Current Thread [Next in Thread]