FS#7849 - set_time() uses rtc_write_time() incorrectly
set_time() in timefuncs.c expects rtc_write_time() to return 0 on success. However, all rtc_write_time() functions return 1 always (no error checking is done). So set_time() always returns a failure even if clock was set correctly.
Closed by bertrik
2008-04-15 18:34
Reason for closing: Fixed
Additional comments about closing: Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407
2008-04-15 18:34
Reason for closing: Fixed
Additional comments about closing: Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407
Fixed in 17123
Loading...
Available keyboard shortcuts
- Alt + ⇧ Shift + l Login Dialog / Logout
- Alt + ⇧ Shift + a Add new task
- Alt + ⇧ Shift + m My searches
- Alt + ⇧ Shift + t focus taskid search
Tasklist
- o open selected task
- j move cursor down
- k move cursor up
Task Details
- n Next task
- p Previous task
- Alt + ⇧ Shift + e ↵ Enter Edit this task
- Alt + ⇧ Shift + w watch task
- Alt + ⇧ Shift + y Close Task
Task Editing
- Alt + ⇧ Shift + s save task
As far as I can see you’re right, but nobody’s checking the result of set_time() currently.
Attached is a patch that should fix it.
On second thought, the situation is a little more complicated. Depending on the hardware driver, function rtc_write_datetime returns various values, for example the as3514 driver returns 1, the uisim stub returns 0 and the ds1339 driver returns the return value of a call to sw_i2c_write (which itself returns <0 on error and 0 if things are OK).
A common rule to be derived from this, is that <0 means error and >= 0 means OK. Attached is a patch that evaluates the return value like this.