Hey,

> it seems the commit 10584363e87286db96d14e1ad3d6fc7b714ad085 from 2009-10-29 
> 16:49 "utilities: allow creating files during a call to write()" changed the 
> file handling in a way that breaks suspend:
> 
> fosusaged prints the following when trying to suspend:
> WARNING **: utilities.vala:74: can't open for writing to /sys/power/state: 
> File exists
> 
> When I change it back to
>   var fd = Posix.open( filename, Posix.O_WRONLY );
> suspens works again

That's very strange as the commit looks 100% backwards compatible to me.
fsousaged calls

        FsoFramework.FileHandling.write( "mem\n", sys_power_state );

which now has the signature

        public void write( string contents, string filename, bool create =
false )

If create is false, then Posix.open( filename, Posix.O_WRONLY, (mode_t)
0) is being called, as (mode_t)=0 is the default argument for that call.
Hence, nothing should change at all.

man 2 open says: "mode specifies the permissions to use in case a new
file is created.  This argument must be  supplied  when
O_CREAT  is  specified  in flags; if O_CREAT is not specified, then mode
is ignored."

Can you please try what happens when you revert the commit, but use  
        var fd = Posix.open( filename, Posix.O_WRONLY, (mode_t)0 );
instead?

Thanks,

:M:



_______________________________________________
Smartphones-userland mailing list
Smartphones-userland@linuxtogo.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/smartphones-userland

Reply via email to