lkml.org 
[lkml]   [1996]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: include problem: d_namlen in netatalk can not be found
> Apparently the rearrangement of the include files have bitten some other 
> parts. I tried compiling netatalk and ended up with this error:
>
> make[4]: Entering directory
> `/usr/local/cdimage/src/netatalk-1.3.3/etc/afpd'
> gcc -02 -I../../include -DAPPLCNAME -DCRLF -c unix.c -o unix.o
> unix.c: In function `setdeskmode':
> unix.c:314: warning: comparison between pointer and integer
> unix.c:329: structure has no member named `d_namlen'
> unix.c: In function `setdeskowner':
> unix.c:432: warning: comparison between pointer and integer
> unix.c:447: structure has no member named `d_namlen'
>
> [stufff deleted]
>
> This is where I found d_namlen in the includes
>
> d_namlen
>
> /usr/include/dirent.h:#define d_namlen d_reclen /* glibc
> compatibility.
> */
>
> d_reclen is part of the dirent struc.

I had the same problem. The solution is to use strlen() in the cases
where d_namlen is used. Here is a patch against netatalk 1.3.3:

--- ./etc/afpd/enumerate.c.old Fri Feb 16 20:19:51 1996
+++ ./etc/afpd/enumerate.c Fri Feb 16 20:21:01 1996
@@ -168,9 +168,9 @@
continue;
}

- *(sd.sd_last)++ = de->d_namlen;
+ *(sd.sd_last)++ = strlen(de->d_name);

- if ( sd.sd_last + de->d_namlen + 2 > end ) {
+ if ( sd.sd_last + strlen(de->d_name) + 2 > end ) {
start = sd.sd_buf;
if (( sd.sd_buf = (char *)realloc( sd.sd_buf,
sd.sd_buflen + SDBUFBRK )) == NULL ) {
@@ -183,8 +183,8 @@
end = sd.sd_buf + sd.sd_buflen;
}

- bcopy( de->d_name, sd.sd_last, de->d_namlen + 1 );
- sd.sd_last += de->d_namlen + 1;
+ bcopy( de->d_name, sd.sd_last, strlen(de->d_name) + 1 );
+ sd.sd_last += strlen(de->d_name) + 1;
}
*sd.sd_last = 0;

--- ./etc/afpd/unix.c.bak Fri Feb 16 20:17:26 1996
+++ ./etc/afpd/unix.c Fri Feb 16 20:18:42 1996
@@ -325,7 +325,7 @@
}
for ( deskp = readdir( desk ); deskp != NULL; deskp = readdir( desk )) {
if ( strcmp( deskp->d_name, "." ) == 0 ||
- strcmp( deskp->d_name, ".." ) == 0 || deskp->d_namlen > 2 ) {
+ strcmp( deskp->d_name, ".." ) == 0 || strlen(deskp->d_name) > 2 ) {
continue;
}
strcpy( modbuf, deskp->d_name );
@@ -443,7 +443,7 @@
}
for ( deskp = readdir( desk ); deskp != NULL; deskp = readdir( desk )) {
if ( strcmp( deskp->d_name, "." ) == 0 ||
- strcmp( deskp->d_name, ".." ) == 0 || deskp->d_namlen > 2 ) {
+ strcmp( deskp->d_name, ".." ) == 0 || strlen(deskp->d_name) > 2 ) {
continue;
}
strcpy( modbuf, deskp->d_name );
--- ./Makefile.bak Fri Feb 16 20:13:03 1996
+++ ./Makefile Fri Feb 16 20:13:42 1996
@@ -4,7 +4,8 @@

# Root of man pages. Subdirectories will be ${MANDIR}/man1,
# ${MANDIR}/man4, and ${MANDIR}/man8.
-MANDIR=${DESTDIR}/man
+#MANDIR=${DESTDIR}/man
+MANDIR=/usr/local/man

# Location of the AFS and Kerberos libraries and include files. Uncomment
# and edit these if you want to include AFS or Kerberos support in afpd

\
 
 \ /
  Last update: 2005-03-22 13:36    [W:0.033 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site