Ticket #2825 (closed defect: fixed)

Opened 13 years ago

Last modified 12 years ago

filemanager/filegui.c does not compile on Solaris due to missing macros

Reported by: mcermak Owned by: andrew_b
Priority: major Milestone: 4.8.4
Component: mc-core Version: 4.8.1.3
Keywords: Cc:
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master committed-stable

Description

filemanager/filegui.c does not compile on Solaris. This file has following checks for statvfs/statfs struct:

#if defined(STAT_STATVFS) \

&& (defined(HAVE_STRUCT_STATVFS_F_BASETYPE) \

defined(HAVE_STRUCT_STATVFS_F_FSTYPENAME))

#include <sys/statvfs.h>
#define STRUCT_STATFS struct statvfs
#define STATFS statvfs
#elif defined(HAVE_STATFS) && !defined(STAT_STATFS4)
#ifdef HAVE_SYS_VFS_H
#include <sys/vfs.h>
#elif defined(HAVE_SYS_MOUNT_H) && defined(HAVE_SYS_PARAM_H)
#include <sys/param.h>
#include <sys/mount.h>
#elif defined(HAVE_SYS_STATFS_H)
#include <sys/statfs.h>
#endif
#define STRUCT_STATFS struct statfs
#define STATFS statfs
#endif

On Solaris, the first branch should be used but HAVE_STRUCT_STATVFS_F_BASETYPE and HAVE_STRUCT_STATVFS_F_FSTYPENAME macros are not set or even defined in config.h. configure scrips does not even check for those members.

The m4.include/fstypename.m4 should be extended to cover that. Patch included.

Attachments

statvfs-members.patch (506 bytes) - added by mcermak 13 years ago.

Change History

Changed 13 years ago by mcermak

comment:1 in reply to: ↑ description Changed 13 years ago by andrew_b

Replying to mcermak:

filemanager/filegui.c does not compile on Solaris. This file has following checks for statvfs/statfs struct:
[...]
On Solaris, the first branch should be used but HAVE_STRUCT_STATVFS_F_BASETYPE and HAVE_STRUCT_STATVFS_F_FSTYPENAME macros are not set or even defined in config.h. configure scrips does not even check for those members.

I think, these checks should be sync'd with same checks in modern src/stat.c of coreutils package.

The m4.include/fstypename.m4 should be extended to cover that. Patch included.

This file is get directly from gnulib and should be kept as is. Another file should be created to make required extra checks or m4/stat-prog.m4 of coreutils can be get.

comment:2 Changed 13 years ago by andrew_b

  • Status changed from new to accepted
  • Keywords stable-candidate added
  • Owner set to andrew_b
  • Branch state changed from no branch to on review

Branch: 2825_solaris_statvfs_members (parent: master).
changeset:e77c066d2dbc2a504838a22edce66a1e872f20d7

Please review and test.

comment:3 Changed 13 years ago by mcermak

Hi Andrew,
the branch 2825_solaris_statvfs_members builds correctly on Solaris. The resulted binary runs well.

Thanks,
Milan

comment:4 Changed 13 years ago by slavazanko

  • Owner changed from andrew_b to slavazanko
  • Votes for changeset set to slavazanko

comment:5 Changed 13 years ago by slavazanko

  • Status changed from accepted to assigned
  • Owner changed from slavazanko to andrew_b

comment:6 Changed 12 years ago by angel_il

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

comment:7 Changed 12 years ago by andrew_b

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

comment:8 Changed 12 years ago by andrew_b

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