| 66 | } |
| 67 | |
| 68 | static void remove_tempfiles(int in_signal_handler) |
| 69 | { |
| 70 | pid_t me = getpid(); |
| 71 | volatile struct volatile_list_head *pos; |
| 72 | |
| 73 | list_for_each(pos, &tempfile_list) { |
| 74 | struct tempfile *p = list_entry(pos, struct tempfile, list); |
| 75 | |
| 76 | if (!is_tempfile_active(p) || p->owner != me) |
| 77 | continue; |
| 78 | |
| 79 | if (p->fd >= 0) |
| 80 | close(p->fd); |
| 81 | |
| 82 | if (in_signal_handler) |
| 83 | unlink(p->filename.buf); |
| 84 | else |
| 85 | unlink_or_warn(p->filename.buf); |
| 86 | remove_template_directory(p, in_signal_handler); |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | static void remove_tempfiles_on_exit(void) |
| 91 | { |
no test coverage detected