s6

Mirror/fork of https://skarnet.org/software/s6/
git clone https://ccx.te2000.cz/git/s6
Log | Files | Refs | README | LICENSE

commit 0ccb71ef43a4754bf115220e107785f68553f6d1
parent c4f6183f0fd716953cfdc2e1869b5310724a3e57
Author: Laurent Bercot <ska-skaware@skarnet.org>
Date:   Sun,  7 Dec 2014 16:38:18 +0000

Use ftrigw_notify_b in s6-ftrig-notify

Diffstat:
Msrc/include/s6/ftrigw.h | 3+++
Msrc/pipe-tools/s6-ftrig-notify.c | 9++-------
2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/include/s6/ftrigw.h b/src/include/s6/ftrigw.h @@ -3,9 +3,12 @@ #ifndef FTRIGW_H #define FTRIGW_H +#include <skalibs/bytestr.h> + extern int ftrigw_fifodir_make (char const *, int, int) ; extern int ftrigw_notify (char const *, char) ; extern int ftrigw_notifyb (char const *, char const *, unsigned int) ; +#define ftrigw_notifys(f, s) ftrigw_notifyb(f, (s), str_len(s)) extern int ftrigw_clean (char const *) ; #endif diff --git a/src/pipe-tools/s6-ftrig-notify.c b/src/pipe-tools/s6-ftrig-notify.c @@ -7,14 +7,9 @@ int main (int argc, char const *const *argv) { - char const *p ; PROG = "s6-ftrig-notify" ; if (argc < 3) strerr_dieusage(100, USAGE) ; - p = argv[2] ; - for (; *p ; p++) - { - if (ftrigw_notify(argv[1], *p) == -1) - strerr_diefu2sys(111, "notify ", argv[1]) ; - } + if (ftrigw_notifys(argv[1], argv[2]) < 0) + strerr_diefu2sys(111, "notify ", argv[1]) ; return 0 ; }