MCPcopy Create free account
hub / github.com/git/git / systemd_timer_delete_stale_timer_templates

Function systemd_timer_delete_stale_timer_templates

builtin/gc.c:3193–3203  ·  view source on GitHub ↗

* A previous version of Git wrote the timer units as template files. * Clean these up, if they exist. */

Source from the content-addressed store, hash-verified

3191 * Clean these up, if they exist.
3192 */
3193static void systemd_timer_delete_stale_timer_templates(void)
3194{
3195 char *timer_template_name = xstrfmt(SYSTEMD_UNIT_FORMAT, "", "timer");
3196 char *filename = xdg_config_home_systemd(timer_template_name);
3197
3198 if (unlink(filename) && !is_missing_file_error(errno))
3199 warning(_("failed to delete '%s'"), filename);
3200
3201 free(filename);
3202 free(timer_template_name);
3203}
3204
3205static int systemd_timer_delete_unit_files(void)
3206{

Callers 2

Calls 4

xstrfmtFunction · 0.85
xdg_config_home_systemdFunction · 0.85
is_missing_file_errorFunction · 0.85
warningFunction · 0.85

Tested by

no test coverage detected