compile TNG error
nazard at dragoninc.on.ca
nazard at dragoninc.on.ca
Tue Jan 18 00:43:13 GMT 2000
On 18 Jan, Vladimir Stavrinov wrote:
> But there are one more...:
>
> Compiling client/smbmount.c
> client/smbmount.c: In function `close_our_files':
> client/smbmount.c:242: `NR_OPEN' undeclared (first use in this function)
> client/smbmount.c:242: (Each undeclared identifier is reported only once
> client/smbmount.c:242: for each function it appears in.)
> make: *** [client/smbmount.o] Error 1
Here is the patch I wrote to handle this.
Index: samba/source/client/smbmount.c
===================================================================
RCS file: /cvsroot/samba/source/client/smbmount.c,v
retrieving revision 1.27
diff -u -r1.27 smbmount.c
--- smbmount.c 1999/12/01 02:15:10 1.27
+++ smbmount.c 2000/01/18 00:38:25
@@ -239,7 +239,20 @@
close_our_files(void)
{
int i;
- for (i = 0; i < NR_OPEN; i++) {
+ int fileLimit = 1024; /* set a reasonable default size */
+#ifdef NR_OPEN
+ fileLimit = NR_OPEN;
+#endif
+#ifdef HAVE_GETRLIMIT
+ {
+ struct rlimit openFilesLimit;
+ if (getrlimit(RLIMIT_NOFILE, &openFilesLimit) == 0)
+ {
+ fileLimit = openFilesLimit.rlim_cur;
+ }
+ }
+#endif
+ for (i = 0; i < fileLimit; i++) {
if (i == Client) {
continue;
}
More information about the samba-ntdom
mailing list