Kaynağa Gözat

faux.ev: bool_t retval for faux_ev_reschedule()

Serj Kalichev 3 yıl önce
ebeveyn
işleme
af26d18981
2 değiştirilmiş dosya ile 5 ekleme ve 5 silme
  1. 1 1
      faux/sched.h
  2. 4 4
      faux/sched/ev.c

+ 1 - 1
faux/sched.h

@@ -31,7 +31,7 @@ void faux_ev_free(void *ptr);
 bool_t faux_ev_set_periodic(faux_ev_t *ev,
 	const struct timespec *interval, unsigned int cycle_num);
 int faux_ev_dec_cycles(faux_ev_t *ev, unsigned int *new_cycle_num);
-int faux_ev_reschedule(faux_ev_t *ev, const struct timespec *new_time);
+bool_t faux_ev_reschedule(faux_ev_t *ev, const struct timespec *new_time);
 int faux_ev_reschedule_period(faux_ev_t *ev);
 int faux_ev_time_left(faux_ev_t *ev, struct timespec *left);
 int faux_ev_id(const faux_ev_t *ev);

+ 4 - 4
faux/sched/ev.c

@@ -196,13 +196,13 @@ int faux_ev_dec_cycles(faux_ev_t *ev, unsigned int *new_cycle_num)
  *
  * @param [in] ev Allocated and initialized ev object.
  * @param [in] new_time New time of event (FAUX_SCHED_NOW for now).
- * @return 0 - success, < 0 on error.
+ * @return BOOL_TRUE - success, BOOL_FALSE on error.
  */
-int faux_ev_reschedule(faux_ev_t *ev, const struct timespec *new_time)
+bool_t faux_ev_reschedule(faux_ev_t *ev, const struct timespec *new_time)
 {
 	assert(ev);
 	if (!ev)
-		return -1;
+		return BOOL_FALSE;
 
 	if (new_time) {
 		ev->time = *new_time;
@@ -210,7 +210,7 @@ int faux_ev_reschedule(faux_ev_t *ev, const struct timespec *new_time)
 		faux_timespec_now(&(ev->time));
 	}
 
-	return 0;
+	return BOOL_TRUE;
 }