maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   maemo-optify-boottime.log growing every boot (https://talk.maemo.org/showthread.php?t=87765)

ikerrg 2012-11-08 13:24

Re: maemo-optify-boottime.log growing every boot
 
Quote:

Originally Posted by reinob (Post 1291799)
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?

reinob 2012-11-08 13:57

Re: maemo-optify-boottime.log growing every boot
 
Quote:

Originally Posted by ikerrg (Post 1291822)
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!

ikerrg 2012-11-08 14:29

Re: maemo-optify-boottime.log growing every boot
 
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


All times are GMT. The time now is 11:30.

vBulletin® Version 3.8.8