* Callback function that will be invoked on the process exit. This will * process the list of all the registered sharedfilesets and delete the * underlying files. */
| 264 | * underlying files. |
| 265 | */ |
| 266 | static void |
| 267 | SharedFileSetDeleteOnProcExit(int status, Datum arg) |
| 268 | { |
| 269 | /* |
| 270 | * Remove all the pending shared fileset entries. We don't use foreach() |
| 271 | * here because SharedFileSetDeleteAll will remove the current element in |
| 272 | * filesetlist. Though we have used foreach_delete_current() to remove the |
| 273 | * element from filesetlist it could only fix up the state of one of the |
| 274 | * loops, see SharedFileSetUnregister. |
| 275 | */ |
| 276 | while (list_length(filesetlist) > 0) |
| 277 | { |
| 278 | SharedFileSet *fileset = (SharedFileSet *) linitial(filesetlist); |
| 279 | |
| 280 | SharedFileSetDeleteAll(fileset); |
| 281 | } |
| 282 | |
| 283 | filesetlist = NIL; |
| 284 | } |
| 285 | |
| 286 | /* |
| 287 | * Unregister the shared fileset entry registered for cleanup on proc exit. |
nothing calls this directly
no test coverage detected