• Status Closed
  • Percent Complete
  • Task Type Bugs
  • Category Operating System/Drivers
  • Assigned To No-one
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version Daily build (which?)
  • Due in Version Undecided
  • Due Date Undecided
  • Votes 1
  • Private
Attached to Project: Rockbox
Opened by vik - 2007-09-28
Last edited by bertrik - 2008-04-15

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

Fixed in 17123

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.


Available keyboard shortcuts


Task Details

Task Editing