From owner-freebsd-emulation@FreeBSD.ORG Sun Sep 10 12:56:25 2006 Return-Path: X-Original-To: emulation@freebsd.org Delivered-To: freebsd-emulation@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3E53916A403 for ; Sun, 10 Sep 2006 12:56:25 +0000 (UTC) (envelope-from saper@SYSTEM.PL) Received: from mail01.ish.de (pip251.ish.de [80.69.98.251]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9C58E43D49 for ; Sun, 10 Sep 2006 12:56:24 +0000 (GMT) (envelope-from saper@SYSTEM.PL) Received: from [81.210.201.87] (account saper@iesy.net HELO saperski.saper.info) by mail-fe-01.mail01.ish.de (CommuniGate Pro SMTP 5.0.6) with ESMTPSA id 75447145; Sun, 10 Sep 2006 14:56:22 +0200 Received: from [127.0.0.1] (saperski.saper.info [127.0.0.1]) by saperski.saper.info (8.13.8/8.13.8) with ESMTP id k8ACu88F002394 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sun, 10 Sep 2006 14:56:15 +0200 (CEST) (envelope-from saper@SYSTEM.PL) Message-ID: <45040B68.8010302@SYSTEM.PL> Date: Sun, 10 Sep 2006 14:56:08 +0200 From: Marcin Cieslak User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.0.4) Gecko/20060721 SeaMonkey/1.0.2 MIME-Version: 1.0 To: Alexander Leidinger References: <20060910123402.000e1358@Magellan.Leidinger.net> <4503F8A2.1030104@SYSTEM.PL> <20060910144812.6933ffd1@Magellan.Leidinger.net> In-Reply-To: <20060910144812.6933ffd1@Magellan.Leidinger.net> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Cc: emulation@freebsd.org Subject: remove() problem fixed X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Sep 2006 12:56:25 -0000 The fix for remove() was ... trivial. We need to introduce non POSIX compliant behaviour of unlink(2). No idea why it worked, probably libc checked for directory instead of the EISDIR error value. Sorry for versioning crap, I am using my normal buildworld environment stuff. Is there anyway I can make easily make diffs to p4 repo? If not, I will have to go head and install whole CVS repository to finally be able to "cvs diff" Now unlink() gets EISDIR instead of EPERM and remove() is able to recover. -- << Marcin Cieslak // saper@system.pl >> --- linux_file.c Sun Sep 10 14:41:16 2006 +++ linux_file.c_new Sun Sep 10 14:36:08 2006 @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: /repoman/r/ncvs/src/sys/compat/linux/linux_file.c,v 1.91 2005/04/13 04:31:43 mdodd Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_file.c,v 1.91 2005/04/13 04:31:43 mdodd Exp $"); #include "opt_compat.h" #include "opt_mac.h" @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -502,6 +503,7 @@ { char *path; int error; + struct stat sbp; LCONVPATHEXIST(td, args->path, &path); @@ -511,6 +513,11 @@ #endif error = kern_unlink(td, path, UIO_SYSSPACE); + if (error == EPERM) + /* Introduce POSIX noncompliant behaviour of Linux */ + if (kern_stat(td, path, UIO_SYSSPACE, &sbp) == 0) + if (S_ISDIR(sbp.st_mode)) + error = EISDIR; LFREEPATH(path); return (error); }