On 5/4/2011 8:58 AM, John Mathew wrote:
> Powertop2 uses debugfs. Currently it uses /bin/mount to mount
> the debugfs. This doesnt work in Android. This patch enables
> mounting of debugfs in Android
> ---
>   main.cpp |   31 ++++++++++++++++++++++++++++++-
>   1 files changed, 30 insertions(+), 1 deletions(-)
>
> diff --git a/main.cpp b/main.cpp
> index 9fc358c..cb7fcc5 100644
> --- a/main.cpp
> +++ b/main.cpp
> @@ -192,6 +192,22 @@ void out_of_memory()
>       abort();
>   }
>
> +bool fileexists(string strFilename)

studlyCaps ??
> +{
> +     struct stat stFileInfo;
> +     bool blnReturn;
> +     int intStat;
> +
> +     // Attempt to get the file attributes
> +     intStat = stat(strFilename.c_str(),&stFileInfo);
> +     if(intStat == 0)
> +             blnReturn = true;
> +     else
> +             blnReturn = false;
> +
> +     return(blnReturn);

this is not how you do this... access() is the function you want... and 
no need for an abstraction on top....


_______________________________________________
Power mailing list
[email protected]
https://bughost.org/mailman/listinfo/power

Reply via email to