bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#9002: file-error Doing chown operation not permitted


From: Paul Eggert
Subject: bug#9002: file-error Doing chown operation not permitted
Date: Sat, 16 Jul 2011 18:21:15 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110617 Thunderbird/3.1.11

On 07/16/11 14:59, Paul Eggert wrote:
> copy-file's help string says "try to
> transfer the uid and gid", with the implication that it's OK
> if the attempt fails and no diagnosis should be made.

In further building/testing I ran into a problem with that patch:
it runs afoul of fchown's __attribute__((warn_unused_result)) in
recent glibc versions.  I've installed the following further patch
to address this:

=== modified file 'src/ChangeLog'
--- src/ChangeLog       2011-07-16 23:40:44 +0000
+++ src/ChangeLog       2011-07-17 01:18:51 +0000
@@ -1,3 +1,11 @@
+2011-07-17  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * fileio.c (Fcopy_file): Pacify gcc re fchown.  (Bug#9002)
+       This works around a problem with the previous change to Fcopy_file.
+       Recent glibc declares fchown with __attribute__((warn_unused_result)),
+       and without this change, GCC might complain about discarding
+       fchown's return value.
+
 2011-07-16  Juanma Barranquero  <lekktu@gmail.com>
 
        * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).

=== modified file 'src/fileio.c'
--- src/fileio.c        2011-07-16 21:53:38 +0000
+++ src/fileio.c        2011-07-17 01:18:51 +0000
@@ -38,6 +38,8 @@
 #include <selinux/context.h>
 #endif
 
+#include <ignore-value.h>
+
 #include "lisp.h"
 #include "intervals.h"
 #include "buffer.h"
@@ -1960,7 +1962,7 @@
   if (input_file_statable_p)
     {
       if (!NILP (preserve_uid_gid))
-       fchown (ofd, st.st_uid, st.st_gid);
+       ignore_value (fchown (ofd, st.st_uid, st.st_gid));
       if (fchmod (ofd, st.st_mode & 07777) != 0)
        report_file_error ("Doing chmod", Fcons (newname, Qnil));
     }






reply via email to

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