@@ -567,13 +567,10 @@ _child_can_be_restarted(struct child_s *sd)
567
567
int
568
568
supervisor_children_get_info (const gchar * key , struct child_info_s * ci )
569
569
{
570
- struct child_s * sd ;
571
-
572
- if (!key || !ci || !* key ) {
573
- errno = EINVAL ;
574
- return -1 ;
575
- }
570
+ g_assert_nonnull (key );
571
+ g_assert_nonnull (ci );
576
572
573
+ struct child_s * sd ;
577
574
if (!(sd = supervisor_get_child (key ))) {
578
575
errno = ENOENT ;
579
576
return -1 ;
@@ -587,10 +584,9 @@ supervisor_children_get_info(const gchar *key, struct child_info_s *ci)
587
584
guint
588
585
supervisor_children_killall (int sig )
589
586
{
590
- guint count ;
591
- struct child_s * sd ;
587
+ guint count = 0 ;
592
588
593
- count = 0 ;
589
+ struct child_s * sd ;
594
590
FOREACH_CHILD (sd ) {
595
591
if (sd -> pid > 0 ) {
596
592
if (0 == kill (sd -> pid , sig ))
@@ -604,10 +600,9 @@ supervisor_children_killall(int sig)
604
600
guint
605
601
supervisor_children_start_enabled (void * udata , supervisor_cb_f cb )
606
602
{
607
- guint count , proc_count ;
608
- struct child_s * sd ;
603
+ guint count = 0U , proc_count = 0U ;
609
604
610
- count = proc_count = 0U ;
605
+ struct child_s * sd ;
611
606
FOREACH_CHILD (sd ) {
612
607
613
608
proc_count ++ ;
@@ -635,10 +630,9 @@ supervisor_children_start_enabled(void *udata, supervisor_cb_f cb)
635
630
guint
636
631
supervisor_children_mark_obsolete (void )
637
632
{
638
- guint count ;
639
- struct child_s * sd ;
633
+ guint count = 0 ;
640
634
641
- count = 0 ;
635
+ struct child_s * sd ;
642
636
FOREACH_CHILD (sd ) {
643
637
FLAG_SET (sd , MASK_OBSOLETE );
644
638
count ++ ;
@@ -650,10 +644,9 @@ supervisor_children_mark_obsolete(void)
650
644
guint
651
645
supervisor_children_disable_obsolete (void )
652
646
{
653
- guint count ;
654
- struct child_s * sd ;
647
+ guint count = 0 ;
655
648
656
- count = 0U ;
649
+ struct child_s * sd ;
657
650
FOREACH_CHILD (sd ) {
658
651
if (FLAG_HAS (sd ,MASK_OBSOLETE )) {
659
652
FLAG_SET (sd , MASK_DISABLED );
@@ -771,7 +764,6 @@ supervisor_children_register(const gchar *key, const gchar *cmd)
771
764
/* check if the service is present */
772
765
FOREACH_CHILD (sd ) {
773
766
if (0 == g_ascii_strcasecmp (sd -> key , key )) {
774
-
775
767
/* the command might have changed */
776
768
if (sd -> command )
777
769
g_free (sd -> command );
0 commit comments