- Status Closed
- Percent Complete
- Task Type Bugs
- Category User Interface → Simulator
-
Assigned To
safetydan - Operating System All players
- Severity Low
- Priority Very Low
- Reported Version
- Due in Version Undecided
-
Due Date
Undecided
- Votes
- Private
FS#5452 - Some file creation operations fail in the simulators
Context:
I'm running the siulator in Debian GNU/Linux with a 2.6.16 kernel. I've
got simulators set up for several of the devices, and the bug exists in
all of them. I'm phyically running rockbox on an iAudio X5L (not that
that matters much for this bug report).
Example of problem:
Brickmania highscores, eq settings, etc are not being saved properly
in the simulator.
Description:
Files are being created in the wrong mode. Looking through the sources, I
see that the creat function (and correspondingly sim_creat in the
simulator) are usually called with the mode O_WRONLY. This works fine in
both simulator and on my X5.
However, at the places listed below the numeric constant 0 is used as the
mode. For the instances I've been able to try, they work on the X5, but
fail in the simulator.
apps/eq_menu.c: fd = creat(filename,0);
apps/plugins/battery_test.c: f = rb→creat("/battery.dummy", 0);
apps/plugins/calendar.c: fq = rb→creat("/.rockbox/~temp", 0);
apps/plugins/calendar.c: fp = rb→creat("/.rockbox/.memo", 0);
apps/plugins/configfile.c: fd = cfg_rb→creat(buf, 0);
apps/plugins/iriverify.c: fd = rb→creat(tmpfilename, 0);
apps/plugins/search.c: fdw = rb→creat(resultfile,0);
apps/plugins/sort.c: fd = rb→creat(tmpfilename, 0);
apps/settings.c: fd = creat(filename,0);
apps/tree.c: fd = creat(filename,0);
firmware/font.c: glyph_file = creat(GLYPH_CACHE_FILE, 0);
It seems likely that changing 0 to O_WRONLY in the above would fix the
problem in the short term. I won't submit a patch for this, as I don't yet
feel that I fully understanding the issues.
A little more exploring suggests that there's a weirdness about how the
simulator views file modes. In uisimulator/common/io.c, the function
rockbox2sim is clearly intended to converts a mode_t for a real device
into a mode_t for the simulator. The code shows that the simulator expects
1 to correspond to a WRONLY mode, not 0.
I can't find a place where these mode values are documented (which doesn't
mean there isn't one). However, if the logic of the modes really is
different between the versions, then perhaps Rockbox should define it's
own modes which get #defined one way for the simulators and another way
for the device. (Of course, this may already be what's happening, since
O_WRONLY works on both simulator and device.)
2006-05-30 11:32
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
This should now be fixed in CVS builds.
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
0 is actually O_RDONLY so the rockbox2sim function is working correctly. It's all those creat() calls that are wrong.