Am Montag 16 November 2009 16:34:43 schrieben Sie:
> 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?
the results are very strange. After your test worked correctly, I inserted a 
warning in the if(create) {} block, that told me it jumps into it when trying 
to suspend.

Another test I did was to set "if ( create == true)" which made suspend 
working again.

But then I did try to recompile fsousaged against the new libfsobasics - and 
now it also works again - so it seems there was only a communication-problem 
of my old usaged with the new libfsobasics - in the future I must remember to 
try this before spamming the mailing list :-) 

Heiko

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

Reply via email to