Ticket #2516 (closed defect: fixed)
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 {
!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
Change History
comment:3 Changed 14 years ago by zaytsev
- Status changed from new to accepted
- severity changed from no branch to on review
- Owner set to zaytsev
- Version changed from 4.7.5 to master
- Milestone changed from 4.8 to 4.8.0-pre1
- Keywords stable-candidate added; dragonflybsd vfs removed
Branch: 2516_dragonfly_bsd (parent: master)
Changeset: http://www.midnight-commander.org/changeset/2516_dragonfly_bsd
comment:4 follow-up: ↓ 5 Changed 14 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 14 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 14 years ago by zaytsev
- severity changed from on review to on rework
You are right. Will do. Eventually ;-)
comment:7 Changed 14 years ago by andrew_b
- Priority changed from major to critical
- Owner changed from zaytsev to andrew_b
- severity changed from on rework to on review
Please review again.
comment:9 Changed 14 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 14 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.
comment:11 Changed 14 years ago by andrew_b
OK. NAME_MAX is used.
comment:12 Changed 14 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
Merged to master: changeset:32bffa8890059f57ad0bdd5ab8a82e7bd386a518
Fixed in 4.7.5-stable: changeset:726d68d14fed90fff8e0b91c0fa63ccb882eedde
Fixed in 4.7.0-stable: changeset:88c87ceb68dd07866c7a28decb9ff8163782bf8a