From 7b2faca5b09131f1559a65a3487cee16fe3393c6 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Wed, 16 Sep 2015 21:54:15 +0000 Subject: s6-rc-update bigfux --- doc/s6-rc-update.html | 13 +++++++++++++ src/libs6rc/s6rc_servicedir_manage.c | 24 +++++++++++++----------- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/doc/s6-rc-update.html b/doc/s6-rc-update.html index ac8377a..965cc70 100644 --- a/doc/s6-rc-update.html +++ b/doc/s6-rc-update.html @@ -245,5 +245,18 @@ restart.
  • It will rename sqld to mysqld and make it restart. +

    Notes

    + + + diff --git a/src/libs6rc/s6rc_servicedir_manage.c b/src/libs6rc/s6rc_servicedir_manage.c index e06d7a4..a6775f1 100644 --- a/src/libs6rc/s6rc_servicedir_manage.c +++ b/src/libs6rc/s6rc_servicedir_manage.c @@ -39,28 +39,30 @@ int s6rc_servicedir_manage (char const *live, tain_t const *deadline, tain_t *st if (d->d_name[0] == '.') continue ; { unsigned int len = str_len(d->d_name) ; + int r ; uint16 id ; char srcfn[livelen + 20 + len] ; char dstfn[livelen + 10 + len] ; - register int r ; byte_copy(srcfn, livelen + 12, dirfn) ; srcfn[livelen + 12] = '/' ; byte_copy(srcfn + livelen + 13, len + 1, d->d_name) ; r = s6_svc_ok(srcfn) ; if (r < 0) { e = errno ; goto err ; } - if (r) continue ; - byte_copy(srcfn + livelen + 13 + len, 6, "/down") ; - if (!touch(srcfn)) { e = errno ; goto err ; } - byte_copy(srcfn + livelen + 14 + len, 6, "event") ; - if (!ftrigw_fifodir_make(srcfn, gid, 0)) { e = errno ; goto err ; } - id = ftrigr_subscribe(&a, srcfn, "s", 0, deadline, stamp) ; - if (!id) { e = errno ; goto err ; } - if (!genalloc_append(uint16, &ids, &id)) { e = errno ; goto err ; } - srcfn[livelen + 13 + len] = 0 ; + if (!r) + { + byte_copy(srcfn + livelen + 13 + len, 6, "/down") ; + if (!touch(srcfn)) { e = errno ; goto err ; } + byte_copy(srcfn + livelen + 14 + len, 6, "event") ; + if (!ftrigw_fifodir_make(srcfn, gid, 0)) { e = errno ; goto err ; } + id = ftrigr_subscribe(&a, srcfn, "s", 0, deadline, stamp) ; + if (!id) { e = errno ; goto err ; } + if (!genalloc_append(uint16, &ids, &id)) { e = errno ; goto err ; } + srcfn[livelen + 13 + len] = 0 ; + } byte_copy(dstfn, livelen, live) ; byte_copy(dstfn + livelen, 9, "/scandir/") ; byte_copy(dstfn + livelen + 9, len + 1, d->d_name) ; - if (symlink(srcfn, dstfn) < 0) { e = errno ; goto err ; } + if (symlink(srcfn, dstfn) < 0 && (!r || errno != EEXIST)) { e = errno ; goto err ; } } } if (errno) { e = errno ; goto err ; } -- cgit v1.2.3