Ticket #1642 (closed enhancement: fixed)

Opened 9 years ago

Last modified 9 years ago

filegui.c contains Linux-specific things

Reported by: sfionov Owned by: slavazanko
Priority: major Milestone: 4.7.0-pre4
Component: mc-core Version: 4.7.0-pre2
Keywords: Cc:
Blocked By: Blocking:
Branch state: Votes for changeset: committed-master

Description

mc 4.7.0-pre1 introduced dynamic "Save attributes" checkbox value in Copy/Move? dialog.
But code is Linux-specific, and not even isolated by macros.

I suggest to add code specific for BSD and SVR4 systems.

In BSD systems (MacOS X, NetBSD, FreeBSD) there is statfs.f_fstypename which contains name of filesystem.
Valid FS names are: msdos, msdosfs (FreeBSD), ntfs, smbfs, procfs, fusefs (BSD), fusefs_subfstype (Mac)

In SVR4 systems (Solaris and other SVR4 Unixes) there are statvfs.f_basetype and statvfs syscall instead of statfs and also autotools define STAT_STATVFS.
Valid FS names are: pcfs, proc, ntfs, fuse, smbfs

(Note that NetBSD 3.0+ also use statvfs but with BSD syntax.)

For all other OSes we simply return 1.

I attached a proposed patch tested on Linux, Solaris and FreeBSD.

Attachments

mc-fstype.diff (3.1 KB) - added by sfionov 9 years ago.
ifdef.patch (2.6 KB) - added by sfionov 9 years ago.

Change History

Changed 9 years ago by sfionov

comment:1 Changed 9 years ago by sfionov

Updated patch with refined macro conditions. Compiles and works at least on Linux, FreeBSD, NetBSD and Solaris.

comment:2 Changed 9 years ago by slavazanko

  • Milestone changed from 4.7 to 4.7.0-pre4

comment:3 Changed 9 years ago by slavazanko

  • Status changed from new to accepted
  • Owner set to slavazanko

comment:4 Changed 9 years ago by slavazanko

  • severity changed from no branch to on review

Please, in future prepare patches via git format-patch command.

Created branch 1642_linux_specific_things

initial changeset:5643f591530737aa90a2e4a1a342bc8866ce06e5

review, please.

comment:5 Changed 9 years ago by slavazanko

  • Votes for changeset set to slavazanko

comment:6 Changed 9 years ago by sfionov

  • Votes for changeset slavazanko deleted
  • severity changed from on review to on rework

Please pull into a new branch from

git://github.com/sigwall/mc-dev.git 1642_fstype

Shortlog:

Sergey Fionov (3):
      Merge branch '1642_linux_specific_things' of git://midnight-commander.org/git/mc into 1642_fstype
      Ticket #1642
      Ticket #1642: Revert configure.ac

sfionov (1):
      Ticket #1642: filegui.c contains Linux-specific things

Diffstat:

 m4.include/ac-get-fs-info.m4 |    5 ++++
 src/filegui.c                |   51 +++++++++++++++++++++++++++++++----------
 2 files changed, 43 insertions(+), 13 deletions(-)

comment:7 Changed 9 years ago by slavazanko

  • severity changed from on rework to on review

Looks good.

Not all developers have full access to Internet (but have full access to m-c.o). Therefore, branch 1642_fstype was copied to upstream repo:
initial changeset:20c3ae911c8972c8b3b629130336d73f32b12071

review, please.

comment:8 Changed 9 years ago by andrew_b

Please use #ifdef or #if defined forms of preprocessor directives instead of

#if USE_STATFS || USE_STATVFS

Changed 9 years ago by sfionov

comment:9 Changed 9 years ago by sfionov

Fixed in attached patch

comment:10 Changed 9 years ago by slavazanko

  • Votes for changeset set to slavazanko

Looks good. See 1642_fstype branch:

Vote here.

comment:11 Changed 9 years ago by andrew_b

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

comment:12 Changed 9 years ago by slavazanko

  • Status changed from accepted to testing
  • Votes for changeset changed from slavazanko andrew_b to commited-master
  • Resolution set to fixed
  • severity changed from approved to merged

comment:13 Changed 9 years ago by slavazanko

  • Status changed from testing to closed

comment:14 Changed 9 years ago by slavazanko

Sorry, Merge changeset is 720eca3fa39b4f51ef5bfde4bb5733dced9578e5

comment:15 Changed 9 years ago by zaytsev

WARNING!!!

misc/skins/Makefile.am ¶
r6d5ccc rca7909
4 4 default.ini \
5 5 gotar.ini \

6 darkfar.ini \

THAT DOES NOT BELONG TO THIS CHANGESET AND MIGHT BREAK RPM BUILDS IF YOU DON'T UPDATE THE PACKAGES ACCORDINGLY!!!

Note: See TracTickets for help on using tickets.