From mboxrd@z Thu Jan 1 00:00:00 1970 From: Piter PUNK Date: Tue, 07 Nov 2006 17:49:56 +0000 Subject: Re: rule_generator.functions: invalid PATH? Message-Id: <4550C744.4070606@terra.com.br> MIME-Version: 1 Content-Type: multipart/mixed; boundary="------------010602000208080605020600" List-Id: References: <454EA668.7030203@kadzban.is-a-geek.net> In-Reply-To: <454EA668.7030203@kadzban.is-a-geek.net> To: linux-hotplug@vger.kernel.org This is a multi-part message in MIME format. --------------010602000208080605020600 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, This patch removes the readlink in rule_generator.functions. The patch uses cd and built-in pwd, as pointed by Kay Sievers and Marco D'Itri and the file exist test is changed from [ -e ] to [ -d ] as pointed by Muneda Takahiro. I hope it's ok now, Piter PUNK -- | E-Mail: piterpk@terra.com.br (personal) .|. roberto.batista@ntux.com.br (professional) /V\ // \\ UIN:116043354 Homepage:http://piterpunk.info02.com.br /( )\ ^`~'^ ----> Slackware Linux - The Best One! <---- #105432 --------------010602000208080605020600 Content-Type: text/plain; name="remove_readlink.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="remove_readlink.patch" --- udev-103/extras/rule_generator/rule_generator.functions 2006-10-20 09:43:35.000000000 -0300 +++ udev-103pk/extras/rule_generator/rule_generator.functions 2006-11-07 15:38:13.000000000 -0200 @@ -18,8 +18,11 @@ sysreadlink() { local file="$1" - [ -e "/sys$DEVPATH/$file" ] || return 0 - readlink -f /sys$DEVPATH/$file 2> /dev/null || true + local OLD_DIRECTORY=$(pwd) + [ -d "/sys$DEVPATH/$file" ] || return 0 + cd /sys$DEVPATH/$file + pwd -P + cd "$OLD_DIRECTORY" } # Return true if a directory is writeable. --------------010602000208080605020600 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 --------------010602000208080605020600 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel --------------010602000208080605020600--