mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Enable compilation of fs/readdir.c for gcc 2.95.2
@ 2002-12-30 22:43 Ingo Oeser
  0 siblings, 0 replies; only message in thread
From: Ingo Oeser @ 2002-12-30 22:43 UTC (permalink / raw)
  To: linux-kernel

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

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-12-31  7:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-30 22:43 [PATCH] Enable compilation of fs/readdir.c for gcc 2.95.2 Ingo Oeser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®