FS#11221 - Make not mix up files

Attached to Project: Rockbox
Opened by Frank Gevaerts (fg) - Monday, 26 April 2010, 23:41 GMT
Last edited by Björn Stenberg (zagor) - Tuesday, 27 April 2010, 11:00 GMT
Task Type Patches
Category Build environment
Status Closed
Assigned To Björn Stenberg (zagor)
Daniel Stenberg (bagder)
Operating System All players
Severity Low
Priority Normal
Reported Version Release 3.4
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


With the original, CGI::tmpFileName() seems to return the same filename again before the move() call in another instance has been completed (or even started). Adding a sleep(1) just before the move() and running many uploads simultaneously results in about 10% wrong files.

The attached patch (suggested by Dave Chapman) fixes the mixup by working with the file handle directly. Adding proper error handling is left as an exercise to the interested perl specialist.
This task depends upon

Closed by  Björn Stenberg (zagor)
Tuesday, 27 April 2010, 11:00 GMT
Reason for closing:  Accepted
Additional comments about closing:  Committed in r25738.