From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14104 invoked by alias); 20 Apr 2004 17:45:01 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 14074 invoked from network); 20 Apr 2004 17:45:00 -0000 Received: from unknown (HELO sunsite.ms.mff.cuni.cz) (195.113.15.26) by sources.redhat.com with SMTP; 20 Apr 2004 17:45:00 -0000 Received: from sunsite.ms.mff.cuni.cz (sunsite.mff.cuni.cz [127.0.0.1]) by sunsite.ms.mff.cuni.cz (8.12.8/8.12.8) with ESMTP id i3KFXK3j020616; Tue, 20 Apr 2004 17:33:20 +0200 Received: (from jakub@localhost) by sunsite.ms.mff.cuni.cz (8.12.8/8.12.8/Submit) id i3KFXK6H020602; Tue, 20 Apr 2004 17:33:20 +0200 Date: Tue, 20 Apr 2004 17:45:00 -0000 From: Jakub Jelinek To: Ulrich Drepper Cc: Glibc hackers Subject: [PATCH] EPERM -> EACCES for s[eh]m_unlink as well Message-ID: <20040420153319.GC5191@sunsite.ms.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-SW-Source: 2004-04/txt/msg00071.txt.bz2 Hi! 2004-04-20 Jakub Jelinek * sysdeps/unix/sysv/linux/shm_open.c (shm_unlink): Change EPERM into EACCES. nptl/ * sem_unlink.c (sem_unlink): Change EPERM into EACCES. --- libc/sysdeps/unix/sysv/linux/shm_open.c.jj 2003-08-26 23:07:48.000000000 +0200 +++ libc/sysdeps/unix/sysv/linux/shm_open.c 2004-04-20 19:30:09.260363887 +0200 @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2001, 2002, 2003, 2004 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 @@ -227,7 +227,10 @@ shm_unlink (const char *name) name, namelen + 1); /* And remove the file. */ - return unlink (fname); + int ret = unlink (fname); + if (ret < 0 && errno == EPERM) + __set_errno (EACCES); + return ret; } --- libc/nptl/sem_unlink.c.jj 2002-12-08 09:17:18.000000000 +0100 +++ libc/nptl/sem_unlink.c 2004-04-20 19:28:07.000000000 +0200 @@ -1,4 +1,4 @@ -/* Copyright (C) 2002 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2002. @@ -60,5 +60,8 @@ sem_unlink (name) name, namelen + 1); /* Now try removing it. */ - return unlink (fname); + int ret = unlink (fname); + if (ret < 0 && errno == EPERM) + __set_errno (EACCES); + return ret; } Jakub