Bug 154711 - soliddevice uses statfs(), should use statvfs() on some OS's
Summary: soliddevice uses statfs(), should use statvfs() on some OS's
Status: RESOLVED FIXED
Alias: None
Product: plasma4
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: NetBSD pkgsrc NetBSD
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-27 21:34 UTC by Mark Davies
Modified: 2007-12-31 20:37 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
NetBSD patch for stat{v,}fs() issue in soliddevice (851 bytes, patch)
2007-12-27 21:38 UTC, Mark Davies
Details
statvfs support with CMake test (2.09 KB, patch)
2007-12-28 00:54 UTC, Alex Merry
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Davies 2007-12-27 21:34:05 UTC
Version:            (using KDE KDE 3.97.0)
Installed from:    NetBSD pkgsrc
Compiler:          gcc4 
OS:                NetBSD

plasma fails to build on NetBSD as soliddevice tries to use statfs() whereas recent NetBSD's use statvfs() (as do some other OS's such as Solaris).
Comment 1 Mark Davies 2007-12-27 21:38:51 UTC
Created attachment 22711 [details]
NetBSD patch for stat{v,}fs() issue in soliddevice

The ST_RDONLY in the patch is a define that happens to exist only on NetBSD's
that use statvfs() rather than statfs().  The correct way to do this would
actually be a CMake test for existence of statvfs() and ifdef based on that,
but I haven't done that yet.
Comment 2 Alex Merry 2007-12-28 00:54:34 UTC
Created attachment 22723 [details]
statvfs support with CMake test

Can you test the attached patch, please?
Comment 3 Mark Davies 2007-12-28 05:42:52 UTC
> Can you test the attached patch, please?

Looks good.  Although your "#warning TODO.." at the end should now presumably read "handle systems without either statvfs() or statfs()"
Comment 4 Alex Merry 2007-12-28 17:53:08 UTC
SVN commit 753861 by alexmerry:

Use statvfs() if available to get disk space (recommended on Linux by LSB and required on NetBSD and Solaris).

BUG: 154711



 M  +2 -0      ConfigureChecks.cmake  
 M  +6 -0      config-workspace.h.cmake  
 M  +12 -2     plasma/dataengines/soliddevice/soliddeviceengine.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=753861
Comment 5 Alex Merry 2007-12-31 20:37:44 UTC
Yes, I realised that after I sent it.  I'll change it before I commit
it.