gc: mark unused descriptors in scheduler callbacks
Each of the scheduler update callbacks gets the descriptor of the lock file, but only the crontab updater needs it. We have to retain the unused descriptors because these are dispatched from a table of function pointers, but we should mark them to silence -Wunused-parameter. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Aug 29, 2023 at 19:45 UTC
316b3a226a16f52fb152d8869aa71233ce47768d
1 file changed
+3
-3
builtin/gc.c
+3
-3
@@ -1934,7 +1934,7 @@ static int launchctl_add_plists(void)
1934
launchctl_schedule_plist(exec_path, SCHEDULE_WEEKLY);
1935
}
1936
1937
-static int launchctl_update_schedule(int run_maintenance, int fd)
1937
+static int launchctl_update_schedule(int run_maintenance, int fd UNUSED)
1938
{
1939
if (run_maintenance)
1940
return launchctl_add_plists();
@@ -2115,7 +2115,7 @@ static int schtasks_schedule_tasks(void)
2115
schtasks_schedule_task(exec_path, SCHEDULE_WEEKLY);
2116
}
2117
2118
-static int schtasks_update_schedule(int run_maintenance, int fd)
2118
+static int schtasks_update_schedule(int run_maintenance, int fd UNUSED)
2119
{
2120
if (run_maintenance)
2121
return schtasks_schedule_tasks();
@@ -2556,7 +2556,7 @@ static int systemd_timer_setup_units(void)
2556
return ret;
2557
}
2558
2559
-static int systemd_timer_update_schedule(int run_maintenance, int fd)
2559
+static int systemd_timer_update_schedule(int run_maintenance, int fd UNUSED)
2560
{
2561
if (run_maintenance)
2562
return systemd_timer_setup_units();