Opened 11 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 by John Small, 11 years ago

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 do not use the actual filename, 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

Version 2, edited 11 years ago by John Small (previous) (next) (diff)

comment:2 by John Small, 11 years ago

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 by Gregg Young, 11 years ago

Milestone: Release_3.22

comment:4 by Gregg Young, 10 years ago

Milestone: Release_3.23Release_3.24

Ticket retargeted after milestone closed

comment:5 by John Small, 9 years ago

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