Active Topics

 


Reply
Thread Tools
Posts: 181 | Thanked: 82 times | Joined on Jan 2010
#11
Originally Posted by reinob View Post
Weird. Just as a test, change the command to

df -m $1 | tail -1 | awk ' { print $4 } '

with -m you get the megabytes directly. I suspect int() may be doing something weird.
No change. Still the same difference. $? is not geting the correct output value from the function for the /home free space when called from my test script. Indeed, the same happens if your try to get the space of /media/mmc1 (which in my case is 25745 MiB). The output number by echo $? is 145!!!

Edit: I have tested the same scripts in my computer's Ubuntu,and the output of the function is the same using echo $? than using echo $space (free space is 7418 MiB in my Ubuntu) . Maybe maemo is using a function output of byte type and numbers longer than 256 cannot be represented. However, Ubuntu works OK for long numbers. Any idea?

Last edited by ikerrg; 2012-11-08 at 13:51.
 

The Following 2 Users Say Thank You to ikerrg For This Useful Post:
Posts: 1,808 | Thanked: 4,272 times | Joined on Feb 2011 @ Germany
#12
Originally Posted by ikerrg View Post
Maybe maemo is using a function output of byte type and numbers longer than 256 cannot be represented. However, Ubuntu works OK for long numbers. Any idea?
Don't know about Ubuntu, but program exit codes should be 8-bit (0-255).
I cannot check that at the moment, but I think your explanation is spot-on.

If you echo $space then it works OK, because $space can hold any value. But $? can, by definition, only be between 0 and 255, so it would explain your observations.

Given that filing a bug report is next-to-useless and Nokia will anyway not fix this, I would suggest you contact the CSSU people and report the bug (an easy solution would be to remove the dfree() function and just "inline" it where it's needed, which is at most 2 or 3 places).

Well done!
 

The Following 3 Users Say Thank You to reinob For This Useful Post:
Posts: 181 | Thanked: 82 times | Joined on Jan 2010
#13
Well, the issue is not big, one can survive with it. Even the best option is uninstalling the full package as you said. However, I liked to learn why it was happening.

Indeed, the dfree() function seems to only be used inside maemo-optify-auto-opt.sh, so only changing the two $? in that script is enough to fix the problem.

Edit: Confirmed!! Changing the dfree funcion as indicated and the two $? inside the maemo-optify-auto-opt.sh script (by $space) make the log error dissapear. However, now there is not an error in the log, but an info message:
optification session started
optification session completed

Last edited by ikerrg; 2012-11-08 at 14:38.
 

The Following 2 Users Say Thank You to ikerrg For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 01:10.