From c1e4f838ac444aa49c16e65c47334315385e5ab1 Mon Sep 17 00:00:00 2001
From: Komeil Parseh <komeilparseh@disroot.org>
Date: Sat, 27 Jun 2026 20:33:15 +0330
Subject: [PATCH] fix sanitize_init build with newer s6

Update ftrigr types and subscription handling to match the current s6
ftrigr API.

---
 src/lib66/sanitize/sanitize_init.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/lib66/sanitize/sanitize_init.c b/src/lib66/sanitize/sanitize_init.c
index 1fbd1c0..c98581b 100644
--- a/src/lib66/sanitize/sanitize_init.c
+++ b/src/lib66/sanitize/sanitize_init.c
@@ -78,7 +78,7 @@ void sanitize_init(service_graph_t *g, uint32_t flag)
     resolve_service_t toclean[g->g.nvertexes], tosubscribe[g->g.nvertexes] ;
     vertex_t *c, *tmp ;
     resolve_service_t *pres ;
-    ftrigr_t fifo = FTRIGR_ZERO ;
+    ftrigr fifo = FTRIGR_ZERO ;
     ss_state_t sta = STATE_ZERO ;
     bool earlier = false, isstarted = false ;
     s6_fdholder_t a = S6_FDHOLDER_ZERO ;
@@ -209,11 +209,11 @@ void sanitize_init(service_graph_t *g, uint32_t flag)
      * */
     if (!FLAGS_ISSET(flag, GRAPH_WANT_EARLIER) && nsubscribe) {
 
-        uint16_t ids[nsubscribe] ;
+        uint32_t ids[nsubscribe] ;
         unsigned int nids = 0, fake = 0 ;
         tain deadline ;
 
-        memset(ids, 0, nsubscribe * sizeof(uint16_t)) ;
+        memset(ids, 0, nsubscribe * sizeof(uint32_t)) ;
 
         tain_now_set_stopwatch_g() ;
         /** TODO
@@ -230,22 +230,21 @@ void sanitize_init(service_graph_t *g, uint32_t flag)
         for (pos = 0 ; pos < nsubscribe ; pos++) {
 
             if (tosubscribe[pos].type == E_PARSER_TYPE_CLASSIC && !tosubscribe[pos].earlier) {
-
                 fake = pos ;
                 char *sa = tosubscribe[pos].sa.s ;
                 char *eventdir = sa + tosubscribe[pos].live.eventdir ;
 
                 log_trace("subcribe to fifo: ", eventdir) ;
                 /** unsubscribe automatically, options is 0 */
-                ids[nids] = ftrigr_subscribe_g(&fifo, eventdir, "s", 0, &deadline) ;
-
-                if (!ids[nids++]) {
+                if (!ftrigr_subscribe_g(&fifo, &ids[nids], 0, 0, eventdir, "s", &deadline)) {
                     cleanup(toclean, ntoclean) ;
                     log_dieusys(LOG_EXIT_SYS, "subcribe to fifo: ", eventdir) ;
                 }
+                ++nids ;
             }
         }
 
+
         if (nids) {
 
             state_set_flag(&sta, STATE_FLAGS_TORELOAD, STATE_FLAGS_TRUE) ;
-- 
2.54.0

