mem: Fix SHM server path cleanup logic

Previously, shared memory server remove old socket *before* filling the
target path into API's data structure. However, the target path might
get truncated hence the path we check against might not be the one we
will be using in the end.

In a case where the path specified by user is free while the truncated
path is in used, gem5 will get a mysterious EADDRINUSE.

We swap the two steps in the CL, so we'll be checking against the actual
path we use, instead of the path user request to use.

Change-Id: Ib34f8b00ea1d2f15dcd4e7b6d2d4a6d6ddc4e411
Reviewed-by: Gabe Black <>
Tested-by: kokoro <>
Maintainer: Gabe Black <>
1 file changed