| 1276 | } |
| 1277 | |
| 1278 | int finish_async(struct async *async) |
| 1279 | { |
| 1280 | #ifdef NO_PTHREADS |
| 1281 | int ret = wait_or_whine(async->pid, "child process", 0); |
| 1282 | |
| 1283 | invalidate_lstat_cache(); |
| 1284 | |
| 1285 | return ret; |
| 1286 | #else |
| 1287 | void *ret = (void *)(intptr_t)(-1); |
| 1288 | |
| 1289 | if (pthread_join(async->tid, &ret)) |
| 1290 | error("pthread_join failed"); |
| 1291 | invalidate_lstat_cache(); |
| 1292 | return (int)(intptr_t)ret; |
| 1293 | |
| 1294 | #endif |
| 1295 | } |
| 1296 | |
| 1297 | int async_with_fork(void) |
| 1298 | { |
no test coverage detected