Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mc fails to build on DragonFlyBSD #2516

Closed
mc-butler opened this issue Mar 27, 2011 · 14 comments
Closed

mc fails to build on DragonFlyBSD #2516

mc-butler opened this issue Mar 27, 2011 · 14 comments
Assignees
Labels
area: vfs Virtual File System support prio: high Serious problem that could block progress
Milestone

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/2516
Reporter cheusov (@cheusov)

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.

Note

Original attachments:

@mc-butler
Copy link
Author

Changed by cheusov (@cheusov) on Mar 27, 2011 at 17:33 UTC

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Mar 27, 2011 at 19:53 UTC (comment 1)

  • Description edited

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Mar 27, 2011 at 19:53 UTC (comment 2)

  • Description edited

@mc-butler
Copy link
Author

Changed by zaytsev (@zyv) on Mar 27, 2011 at 22:19 UTC (comment 3)

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

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

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Mar 28, 2011 at 5:23 UTC (comment 4)

look at lib/fs.h

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

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Mar 29, 2011 at 11:57 UTC (comment 4.5)

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.

@mc-butler
Copy link
Author

Changed by zaytsev (@zyv) on Mar 29, 2011 at 12:01 UTC (comment 6)

  • Severity changed from on review to on rework

You are right. Will do. Eventually ;-)

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Apr 6, 2011 at 11:36 UTC (comment 7)

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

Please review again.

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Apr 6, 2011 at 12:08 UTC (comment 8)

  • Votes set to slavazanko

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Apr 6, 2011 at 12:33 UTC (comment 9)

  • Severity changed from on review to approved
  • Votes changed from slavazanko to slavazanko angel_il

@mc-butler
Copy link
Author

Changed by cheusov (@cheusov) on Apr 6, 2011 at 14:44 UTC (comment 10)

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.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Apr 7, 2011 at 6:23 UTC (comment 11)

OK. NAME_MAX is used.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Apr 7, 2011 at 9:40 UTC (comment 12)

  • Votes changed from slavazanko angel_il to committed-master committed-stable
  • Keywords stable-candidate deleted
  • Resolution set to fixed
  • Severity changed from approved to merged
  • Status changed from accepted to testing

Merged to master: [32bffa8]

Fixed in 4.7.5-stable: [726d68d]

Fixed in 4.7.0-stable: [88c87ceb68dd07866c7a28decb9ff8163782bf8a]

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Apr 7, 2011 at 9:41 UTC (comment 13)

  • Status changed from testing to closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: vfs Virtual File System support prio: high Serious problem that could block progress
Development

No branches or pull requests

2 participants