This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch, master, updated. glibc-2.11-318-gcb652f3
- From: drepper at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 4 Apr 2010 09:09:04 -0000
- Subject: GNU C Library master sources branch, master, updated. glibc-2.11-318-gcb652f3
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via cb652f30b0aa17e65803962305e052e509a5316d (commit)
from 952df0afdca2333e9fae7d62a36077c348d2df93 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=cb652f30b0aa17e65803962305e052e509a5316d
commit cb652f30b0aa17e65803962305e052e509a5316d
Author: Ulrich Drepper <drepper@redhat.com>
Date: Sun Apr 4 02:08:37 2010 -0700
Handle POSIX-compliant errno value of unlink in remove.
diff --git a/ChangeLog b/ChangeLog
index a178be5..5cccc47 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2010-04-04 Ulrich Drepper <drepper@redhat.com>
+ [BZ #11276]
+ * sysdeps/posix/remove.c (IS_NO_DIRECTORY_ERROR): Define.
+ (remove): Use IS_NO_DIRECTORY_ERROR to check for file being no
+ directory.
+ * sysdeps/unix/sysv/linux/remove.c: New file.
+
* conform/data/sys/stat.h-data: Fix testing of S_IS* macros.
[BZ #11279]
diff --git a/sysdeps/posix/remove.c b/sysdeps/posix/remove.c
index c44af92..ae5bbdb 100644
--- a/sysdeps/posix/remove.c
+++ b/sysdeps/posix/remove.c
@@ -1,5 +1,5 @@
/* ANSI C `remove' function to delete a file or directory. POSIX.1 version.
- Copyright (C) 1995,96,97,2002,2003 Free Software Foundation, Inc.
+ Copyright (C) 1995,96,97,2002,2003,2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,6 +21,12 @@
#include <stdio.h>
#include <unistd.h>
+
+#ifndef IS_NO_DIRECTORY_ERROR
+# define IS_NO_DIRECTORY_ERROR errno != EPERM
+#endif
+
+
int
remove (file)
const char *file;
@@ -28,7 +34,7 @@ remove (file)
/* First try to unlink since this is more frequently the necessary action. */
if (__unlink (file) != 0
/* If it is indeed a directory... */
- && (errno != EISDIR
+ && (IS_NO_DIRECTORY_ERROR
/* ...try to remove it. */
|| __rmdir (file) != 0))
/* Cannot remove the object for whatever reason. */
diff --git a/sysdeps/unix/sysv/linux/remove.c b/sysdeps/unix/sysv/linux/remove.c
new file mode 100644
index 0000000..4abf34a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/remove.c
@@ -0,0 +1,2 @@
+#define IS_NO_DIRECTORY_ERROR errno != EISDIR
+#include <sysdeps/posix/remove.c>
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 6 ++++++
sysdeps/posix/remove.c | 10 ++++++++--
sysdeps/unix/sysv/linux/remove.c | 2 ++
3 files changed, 16 insertions(+), 2 deletions(-)
create mode 100644 sysdeps/unix/sysv/linux/remove.c
hooks/post-receive
--
GNU C Library master sources