[uClinux-dev] [Patch]: getcwd() does not work with old kernels 2.0

Harald Küthe Harald.Kuethe at controlware.de
Fri Aug 12 05:18:11 EDT 2005


Well it looks like something got lost with the following commit:
http://www.uclibc.org/cgi-bin/viewcvs.cgi?rev=7408&sortby=file&view=rev

Here is my patch which fixes the getcwd() call at least at my arm7tdmi linux-2.0.x uClinux board.
It seems nobody is using that old stuff :-)

Regards
Harald

--- getcwd.c	2005-08-12 10:49:33.000000000 +0200
+++ getcwd.c.orig	2003-09-22 14:40:11.000000000 +0200
@@ -132,14 +132,6 @@
     struct stat st;
     int olderrno;
 
-	// get stat for root to have a valid parameters for the terminating condition
-	if (stat("/", &st) < 0) {
-		// root dir not found!
-	    return -1;
-	}
-	// start with actual dir
-	if (buf) strncpy(buf, ".", size);
-
     olderrno = errno;
     len = -1;
     cwd = recurser(buf, size, st.st_dev, st.st_ino); 




More information about the uClinux-dev mailing list