all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
Cc: 9002@debbugs.gnu.org
Subject: bug#9002: file-error Doing chown operation not permitted
Date: Sat, 16 Jul 2011 18:21:15 -0700	[thread overview]
Message-ID: <4E22390B.4010009@cs.ucla.edu> (raw)
In-Reply-To: <4E2209AE.1050808@cs.ucla.edu>

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	other threads:[~2011-07-17  1:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-05 12:55 bug#9002: file-error Doing chown operation not permitted jidanni
2011-07-16 21:27 ` Glenn Morris
2011-07-16 21:59   ` Paul Eggert
2011-07-17  1:21     ` Paul Eggert [this message]
2011-07-18 17:24       ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E22390B.4010009@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=9002@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.