Bug 154711

Summary: soliddevice uses statfs(), should use statvfs() on some OS's
Product: [Plasma] plasma4 Reporter: Mark Davies <mark>
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: NetBSD pkgsrc   
OS: NetBSD   
Latest Commit: Version Fixed In:
Attachments: NetBSD patch for stat{v,}fs() issue in soliddevice
statvfs support with CMake test

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.