Subject: Re: Build failure in src/sys/ufs/ufs/ufs_lookup.c
To: None <current-users@netbsd.org>
From: Paul Goyette <paul@whooppee.com>
List: current-users
Date: 02/06/2007 21:38:47
On Tue, 6 Feb 2007, Paul Goyette wrote:

> Updated via CVS on 2007-02-07 04:40 GMT...
>
> Following failure occurs on i386, but does NOT fail on amd64...

Probably because UFS_DIRHASH is not defined in the amd64 kernels...

> cc1: warnings being treated as errors
> /usr/src/sys/ufs/ufs/ufs_lookup.c: In function 'ufs_dirremove':
> /usr/src/sys/ufs/ufs/ufs_lookup.c:1067: warning: value computed is not used
> /usr/src/sys/ufs/ufs/ufs_lookup.c:1067: error: expected ')' before ';' token
> /usr/src/sys/ufs/ufs/ufs_lookup.c:1122: error: too few arguments to function  'ufsdirhash_remove'
> /usr/src/sys/ufs/ufs/ufs_lookup.c:1122: error: expected ';' before '}' token
> /usr/src/sys/ufs/ufs/ufs_lookup.c:1052: error: label 'out' used but not defined

The following patch addresses the compile-time errors:

Index: ufs_lookup.c
===================================================================
RCS file: /cvsroot/src/sys/ufs/ufs/ufs_lookup.c,v
retrieving revision 1.85
diff -u -p -r1.85 ufs_lookup.c
--- ufs_lookup.c	6 Feb 2007 20:49:20 -0000	1.85
+++ ufs_lookup.c	7 Feb 2007 05:12:05 -0000
@@ -1064,7 +1064,7 @@ ufs_dirremove(struct vnode *dvp, struct
  	if (dp->i_dirhash != NULL)
  		ufsdirhash_remove(dp, (dp->i_count == 0) ? ep :
  		   (struct direct *)((char *)ep +
-		   ufs_rw16(ep->d_reclen, needswap), dp->i_offset);
+		   ufs_rw16(ep->d_reclen, needswap)), dp->i_offset);
  #endif

  	if (dp->i_count == 0) {


----------------------------------------------------------------------
|   Paul Goyette   | PGP DSS Key fingerprint: |  E-mail addresses:   |
| Network Engineer | FA29 0E3B 35AF E8AE 6651 |  paul@whooppee.com   |
|                  | 0786 F758 55DE 53BA 7731 | pgoyette@juniper.net |
----------------------------------------------------------------------