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

Info panel can't obtain file system statistics #3277

Closed
mc-butler opened this issue Sep 29, 2014 · 6 comments
Closed

Info panel can't obtain file system statistics #3277

mc-butler opened this issue Sep 29, 2014 · 6 comments
Labels
area: core Issues not related to a specific subsystem prio: low Minor problem or easily worked around
Milestone

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/3277
Reporter mcermak (milan.cermak@….com)

On Solaris, when an info-panel is displayed, the file system information is not shown. No statistics is shown at all, as if the application can't perform statvfs() call.

# mc -V
GNU Midnight Commander 4.8.13
Built with GLib 2.28.6
Using the S-Lang library with terminfo database
With builtin Editor
With subshell support as default
With support for background operations
With mouse support on xterm
With support for X11 events
With internationalization support
With multiple codepages support
Virtual File Systems: cpiofs, tarfs, sfs, extfs, ftpfs, fish
Data types: char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;

This is due to uninitialized variable lockfd in filemanager/mountlist.c read_file_system_list() function (line 1002). lockfd is intialized in conditionally compiled code (line 1012) but used unconditionally (line 1059). This causes an error and the file system list read from /etc/mnttab is thrown away.

Note

Original attachments:

@mc-butler
Copy link
Author

Changed by mcermak (milan.cermak@….com) on Sep 29, 2014 at 12:04 UTC

Patch for 4.8.13

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 29, 2014 at 13:22 UTC (comment 1)

Is the following trivial patch enough?

--- a/src/filemanager/mountlist.c
+++ b/src/filemanager/mountlist.c
@@ -999,7 +999,7 @@ read_file_system_list (int need_fs_type)
         char *table = MNTTAB;
         FILE *fp;
         int ret;
-        int lockfd;
+        int lockfd = -1;
 
 #if defined F_RDLCK && defined F_SETLKW
         /* MNTTAB_LOCK is a macro name of our own invention; it's not present in

@mc-butler
Copy link
Author

Changed by mcermak (milan.cermak@….com) on Sep 29, 2014 at 13:34 UTC (comment 2)

Yes, that'll do. But the variable lockfd is useless when F_RDLCK or F_SETLKW is not defined.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 30, 2014 at 5:42 UTC (comment 2.3)

Actually, most part of mc's mountlist is the mix of gnulib's mountlist and fsusage modules.

Replying to mcermak:

Yes, that'll do. But the variable lockfd is useless when F_RDLCK or F_SETLKW is not defined.

I try keep as much as possible the code taken from gnulib because I sync the mc code with gnulib one.
If you want you can send your patch to gnulib mailing list.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 30, 2014 at 5:51 UTC (comment 4)

  • Blocked by set to #3265

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Dec 10, 2014 at 10:19 UTC (comment 5)

  • Status changed from new to closed
  • Blocked by #3265 deleted
  • Resolution set to fixed
  • Votes set to committed-master

Fixed as part of #3265: [7f8135d].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: core Issues not related to a specific subsystem prio: low Minor problem or easily worked around
Development

No branches or pull requests

1 participant