Skip to contentSkip to conversation

Fix build of fs/ufs/namei.c (was: Linux 2.6.0-test5: ufs build fails)

PATCH New Rolf Eike Beer 1 participant 1 message Sep 9, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix build of fs/ufs/namei.c (was: Linux 2.6.0-test5: ufs build fails)

Von Eyal Lebedinsky:

Quoted 12 lines

allmodconfig on i386:

CC [M] fs/ufs/namei.o
fs/ufs/namei.c: In function `ufs_mknod':
fs/ufs/namei.c:119: parse error before int' fs/ufs/namei.c:127: err' undeclared (first use in this function) fs/ufs/namei.c:127: (Each undeclared identifier is reported only once fs/ufs/namei.c:127: for each function it appears in.) fs/ufs/namei.c:131: warning: control reaches end of non-void function make[2]: *** [fs/ufs/namei.o] Error 1
make[1]: *** [fs/ufs] Error 2
make: *** [fs] Error 2

Your gcc doesn't like declarations after code I think. Try attached patch.

Eike

fs/ufs/namei.c +3 -1
@@ -113,10 +113,12 @@
 static int ufs_mknod (struct inode * dir, struct dentry *dentry, int mode, dev_t rdev)
 {
 	struct inode * inode;
+	int err;
+
 	if (!old_valid_dev(rdev))
 		return -EINVAL;
 	inode = ufs_new_inode(dir, mode);
-	int err = PTR_ERR(inode);
+	err = PTR_ERR(inode);
 	if (!IS_ERR(inode)) {
 		init_special_inode(inode, mode, rdev);
 		/* NOTE: that'll go when we get wide dev_t */