rc_service_schedule_clear returns a bool on error now

This commit is contained in:
Roy Marples 2007-10-04 19:43:01 +00:00
parent a6f2713002
commit 7319c64cff
2 changed files with 8 additions and 4 deletions

View File

@ -591,15 +591,18 @@ bool rc_service_schedule_start (const char *service,
} }
librc_hidden_def(rc_service_schedule_start) librc_hidden_def(rc_service_schedule_start)
void rc_service_schedule_clear (const char *service) bool rc_service_schedule_clear (const char *service)
{ {
char *svc = rc_xstrdup (service); char *svc = rc_xstrdup (service);
char *dir = rc_strcatpaths (RC_SVCDIR, "scheduled", basename (svc), char *dir = rc_strcatpaths (RC_SVCDIR, "scheduled", basename (svc),
(char *) NULL); (char *) NULL);
bool retval;
free (svc); free (svc);
rc_rm_dir (dir, true); if (! (retval = rc_rm_dir (dir, true)) && errno == ENOENT)
retval = true;
free (dir); free (dir);
return (retval);
} }
librc_hidden_def(rc_service_schedule_clear) librc_hidden_def(rc_service_schedule_clear)

View File

@ -153,8 +153,9 @@ bool rc_service_schedule_start (const char *service,
char **rc_services_scheduled_by (const char *service); char **rc_services_scheduled_by (const char *service);
/*! Clear the list of services scheduled to be started by this service /*! Clear the list of services scheduled to be started by this service
* @param service to clear */ * @param service to clear
void rc_service_schedule_clear (const char *service); * @return true if no errors, otherwise false */
bool rc_service_schedule_clear (const char *service);
/*! Checks if a service in in a state /*! Checks if a service in in a state
* @param service to check * @param service to check