[Top][All Lists]

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

acl, copy-file: small refactorings

From: Bruno Haible
Subject: acl, copy-file: small refactorings
Date: Wed, 11 Jan 2012 02:24:34 +0100
User-agent: KMail/4.7.4 (Linux/3.1.0-1.2-desktop; KDE/4.7.4; x86_64; ; )

Here's a proposed series of tweaks and alignments to the 'acl' and 'copy-file'
modules, to make Reuben's proposed change to 'copy-file' easier.

The first change is not backward compatible, but the only users of copy_acl()
are coreutils and 'copy-file' in gnulib, and I've verified that these callers
don't care whether the return value is -1 or -2.

For the third change, I considered exporting just one function copy_acl
with a null_stderr argument, like in the module 'wait-process', rather than
two function qcopy_acl and copy_acl. But I find the approach with two
functions more maintainable: It would make it easier to move the code
that does not emit error message to an LGPLed module.


2012-01-10  Bruno Haible  <address@hidden>

        copy-file: Use 'quote' module consistently.
        * lib/copy-file.c (copy_file_preserving): Use quote().

        copy-file: Refactor.
        * lib/copy-file.c: Include quote.h.
        (copy_file_preserving): Call qcopy_acl instead of copy_acl. Emit error
        message here.
        * modules/copy-file (Depends-on): Add quote.

        acl: Export qcopy_acl.
        * lib/acl.h (qcopy_acl): New declaration.
        * lib/copy-acl.c (qcopy_acl): Make non-static.

        acl: Tweak.
        * lib/set-mode-acl.c (set_acl): Use same variable name as in copy_acl.

        acl: Align return values of copy_acl and qcopy_acl.
        * lib/copy-acl.c (copy_acl): Return the same value as qcopy_acl,
        maybe < -1.

Attachment: 0001-acl-Align-return-values-of-copy_acl-and-qcopy_acl.patch
Description: Text Data

Attachment: 0002-acl-Tweak.patch
Description: Text Data

Attachment: 0003-acl-Export-qcopy_acl.patch
Description: Text Data

Attachment: 0004-copy-file-Refactor.patch
Description: Text Data

Attachment: 0005-copy-file-Use-quote-module-consistently.patch
Description: Text Data

reply via email to

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