Opened 10 years ago

Closed 9 years ago

#524 closed defect (fixed)

Make searchapath thread-safe

Reported by: John Small Owned by: John Small
Priority: minor Milestone: Release_3.24
Component: fm/2 base Version: 3.21
Keywords: Cc:

Description

searchapath (in srchpath.c) uses a static array and returns the address of that array to its callers.

Steven has a note (from 2007) in the code to this effect.

Change History (5)

comment:1 Changed 10 years ago by John Small

Owner: set to John Small
Status: newassigned

To make the function thread-safe, the function's signature will need to change. The new function will: 1) return the return code from DosSearchPath (instead of returning a pointer to a static array as the current code does). 2) require an additional parameter: a pointer to where the function should copy the full filename if the search was successful. Since many calls to the search*path functions only use the (previously) returned filename as a crude return code, this additional parameter can be set to NULL.

Changing the signature means all the functions which call searchapath and searchpath (which relays calls to searchapath) will have to change. Since all the calls to searchpath and searchapath will change, each function's name will be changed to a more descriptive name: searchapath -- > SearchPathForFile searchpath --> SearchMultiplePathsForFile

Last edited 10 years ago by John Small (previous) (diff)

comment:2 Changed 10 years ago by John Small

CS [1750]

In addition to the changes described in the previous comment, the "checkfile" function's signature was changed to accommodate the changed signatures of searchpath (now SearchMultiplePathsForFile) and searchapath (now SearchPathForFile). . So calls to it were also changed.

comment:3 Changed 10 years ago by Gregg Young

Milestone: Release_3.22

comment:4 Changed 9 years ago by Gregg Young

Milestone: Release_3.23Release_3.24

Ticket retargeted after milestone closed

comment:5 Changed 9 years ago by John Small

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.