lkml.org 
[lkml]   [2002]   [Dec]   [31]   [last100]   RSS-feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Complete thread (EXPERIMENTAL)
Patch in this message
/
DateMon, 30 Dec 2002 23:43:49 +0100
FromIngo Oeser <>
Subject[PATCH] Enable compilation of fs/readdir.c for gcc 2.95.2
Digg This
Hi there,

if you also have problems compiling 2.5.5x, then your compiler is too old as is mine.

Anyway, since I don't like to upgrade now, I hacked the offending file fs/readdir.c and can compile a kernel again ;-)
Have fun!

Ingo Oeser


[view this diff only]
diff -Naur linux-2.5.53-mm2/fs/readdir.c linux-2.5.53-mm2-ioe/fs/readdir.c
--- linux-2.5.53-mm2/fs/readdir.c	Fri Dec 27 13:49:53 2002
+++ linux-2.5.53-mm2-ioe/fs/readdir.c	Mon Dec 30 21:51:53 2002
@@ -134,18 +134,18 @@
 		return -EINVAL;
 	dirent = buf->previous;
 	if (dirent) {
-		if (__put_user(offset, &dirent->d_off))
+		if (put_user(offset, &dirent->d_off))
 			goto efault;
 	}
 	dirent = buf->current_dir;
 	buf->previous = dirent;
-	if (__put_user(ino, &dirent->d_ino))
+	if (put_user(ino, &dirent->d_ino))
 		goto efault;
-	if (__put_user(reclen, &dirent->d_reclen))
+	if (put_user(reclen, &dirent->d_reclen))
 		goto efault;
 	if (copy_to_user(dirent->d_name, name, namlen))
 		goto efault;
-	if (__put_user(0, dirent->d_name + namlen))
+	if (put_user(0, dirent->d_name + namlen))
 		goto efault;
 	((char *) dirent) += reclen;
 	buf->current_dir = dirent;
@@ -226,22 +226,22 @@
 		return -EINVAL;
 	dirent = buf->previous;
 	if (dirent) {
-		if (__put_user(offset, &dirent->d_off))
+		if (put_user(offset, &dirent->d_off))
 			goto efault;
 	}
 	dirent = buf->current_dir;
 	buf->previous = dirent;
-	if (__put_user(ino, &dirent->d_ino))
+	if (put_user(ino, &dirent->d_ino))
 		goto efault;
-	if (__put_user(0, &dirent->d_off))
+	if (put_user(0, &dirent->d_off))
 		goto efault;
-	if (__put_user(reclen, &dirent->d_reclen))
+	if (put_user(reclen, &dirent->d_reclen))
 		goto efault;
-	if (__put_user(d_type, &dirent->d_type))
+	if (put_user(d_type, &dirent->d_type))
 		goto efault;
 	if (copy_to_user(dirent->d_name, name, namlen))
 		goto efault;
-	if (__put_user(0, dirent->d_name + namlen))
+	if (put_user(0, dirent->d_name + namlen))
 		goto efault;
 	((char *) dirent) += reclen;
 	buf->current_dir = dirent;
@@ -280,7 +280,9 @@
 	if (lastdirent) {
 		struct linux_dirent64 d;
 		d.d_off = file->f_pos;
-		__put_user(d.d_off, &lastdirent->d_off);
+		error = -EFAULT;
+		if (put_user(d.d_off, &lastdirent->d_off))
+			goto out;
 		error = count - buf.count;
 	}
 
-- 
Science is what we can tell a computer. Art is everything else. --- D.E.Knuth
\
ISP Services
Valid XHTML 1.0!\ /
Valid CSS! Last update: 2005-03-22 12:32    [W:0.084 / U:0.040 seconds]
©2003-2005 Jasper Spaans