Ticket #2516 (closed defect: fixed)

Opened 13 years ago

Last modified 13 years ago

mc fails to build on DragonFlyBSD

Reported by: cheusov Owned by: andrew_b
Priority: critical Milestone: 4.8.0-pre1
Component: mc-vfs Version: master
Keywords: Cc:
Blocked By: Blocking:
Branch state: Votes for changeset: committed-master committed-stable

Description (last modified by angel_il) (diff)

mc fails to build on DragonFlyBSD with the following error message.

vfs.c: In function 'mc_readdir':
vfs.c:802: error: 'MAXNAMLEN' undeclared (first use in this function)
vfs.c:802: error: (Each undeclared identifier is reported only once
vfs.c:802: error: for each function it appears in.)
* Error code 1

This is because DragonFly doesn't provide MAXNAMLEN macros in its header files. Their dirent structure is define like the following.

struct dirent {

#if defined(_KERNEL)
!defined(BSD_VISIBLE)

ino_t d_ino; /* file number of entry */

#else

ino_t d_fileno; /* file number of entry */

#endif

uint16_t d_namlen; /* strlen(d_name) */
uint8_t d_type; /* file type, see blow */
uint8_t d_unused1; /* padding, reserved */
uint32_t d_unused2; /* reserved */
char d_name[255 + 1];

/* name, NUL-terminated */

};

Attached patch solves the problem.

Attachments

patch-lib_vfs_mc-vfs_vfs.c (325 bytes) - added by cheusov 13 years ago.

Change History

Changed 13 years ago by cheusov

comment:1 Changed 13 years ago by angel_il

  • Description modified (diff)

comment:2 Changed 13 years ago by angel_il

  • Description modified (diff)

comment:3 Changed 13 years ago by zaytsev

  • Status changed from new to accepted
  • severity changed from no branch to on review
  • Keywords stable-candidate added; dragonflybsd vfs removed
  • Version changed from 4.7.5 to master
  • Milestone changed from 4.8 to 4.8.0-pre1
  • Owner set to zaytsev

Branch: 2516_dragonfly_bsd (parent: master)
Changeset: http://www.midnight-commander.org/changeset/2516_dragonfly_bsd

comment:4 follow-up: ↓ 5 Changed 13 years ago by angel_il

look at lib/fs.h

...
#ifndef MAXPATHLEN
#define MC_MAXPATHLEN 4096
#else
#define MC_MAXPATHLEN MAXPATHLEN
#endif
...

comment:5 in reply to: ↑ 4 Changed 13 years ago by andrew_b

Replying to angel_il:

look at lib/fs.h

Look here:

70 #ifndef MAXNAMLEN
71 #define MC_MAXFILENAMELEN 256
72 #else
73 #define MC_MAXFILENAMELEN MAXNAMLEN
74 #endif

I think, MAXNAMLEN can be defined here, in #ifndef MAXNAMLEN branch.

comment:6 Changed 13 years ago by zaytsev

  • severity changed from on review to on rework

You are right. Will do. Eventually ;-)

comment:7 Changed 13 years ago by andrew_b

  • Owner changed from zaytsev to andrew_b
  • Priority changed from major to critical
  • severity changed from on rework to on review

Please review again.

comment:8 Changed 13 years ago by slavazanko

  • Votes for changeset set to slavazanko

comment:9 Changed 13 years ago by angel_il

  • Votes for changeset changed from slavazanko to slavazanko angel_il
  • severity changed from on review to approved

comment:10 Changed 13 years ago by cheusov

Why do you guys use constant 256 instead of more portable
NAME_MAX or PATH_MAX?
I guess DragonFlyBSD is not the only system that
doesn't provide MAXNAMLEN.

Last edited 13 years ago by cheusov (previous) (diff)

comment:11 Changed 13 years ago by andrew_b

OK. NAME_MAX is used.

comment:12 Changed 13 years ago by andrew_b

  • Keywords stable-candidate removed
  • Status changed from accepted to testing
  • Votes for changeset changed from slavazanko angel_il to committed-master committed-stable
  • Resolution set to fixed
  • severity changed from approved to merged

comment:13 Changed 13 years ago by andrew_b

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.