aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs6/ftrigw_notifyb_nosig.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2026-03-16 21:09:38 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2026-03-16 21:09:38 +0000
commit41dec6436242c4daccdd9fdee3ac052004c439bd (patch)
treead554b53318b2a0880192f7f021908fd5f03254c /src/libs6/ftrigw_notifyb_nosig.c
parent2505243cd4becc70b6745fb2da742ca8a456a3be (diff)
downloads6-41dec6436242c4daccdd9fdee3ac052004c439bd.tar.gz
Refactor ftrig using sass; clean up API a bit, update its users
Diffstat (limited to 'src/libs6/ftrigw_notifyb_nosig.c')
-rw-r--r--src/libs6/ftrigw_notifyb_nosig.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/libs6/ftrigw_notifyb_nosig.c b/src/libs6/ftrigw_notifyb_nosig.c
index 103e2b9..06abae6 100644
--- a/src/libs6/ftrigw_notifyb_nosig.c
+++ b/src/libs6/ftrigw_notifyb_nosig.c
@@ -10,7 +10,6 @@
#include <skalibs/djbunix.h>
#include <s6/ftrigw.h>
-#include "ftrig1.h"
int ftrigw_notifyb_nosig (char const *path, char const *s, size_t len)
{
@@ -19,10 +18,10 @@ int ftrigw_notifyb_nosig (char const *path, char const *s, size_t len)
if (!dir) return -1 ;
{
size_t pathlen = strlen(path) ;
- char tmp[pathlen + FTRIG1_PREFIXLEN + 35] ;
+ char tmp[pathlen + 41] ;
memcpy(tmp, path, pathlen) ;
tmp[pathlen] = '/' ;
- tmp[pathlen + FTRIG1_PREFIXLEN + 34] = 0 ;
+ tmp[pathlen + 40] = 0 ;
for (;;)
{
direntry *d ;
@@ -30,9 +29,9 @@ int ftrigw_notifyb_nosig (char const *path, char const *s, size_t len)
errno = 0 ;
d = readdir(dir) ;
if (!d) break ;
- if (strncmp(d->d_name, FTRIG1_PREFIX ":@", FTRIG1_PREFIXLEN + 2)) continue ;
- if (strlen(d->d_name) != FTRIG1_PREFIXLEN + 33) continue ;
- memcpy(tmp + pathlen + 1, d->d_name, FTRIG1_PREFIXLEN + 33) ;
+ if (strncmp(d->d_name, "ftrig1:@", 8)) continue ;
+ if (strlen(d->d_name) != 39) continue ;
+ memcpy(tmp + pathlen + 1, d->d_name, 39) ;
fd = open_write(tmp) ;
if (fd == -1)
{