From 24d4e50eca03385c0f4b45f51092f4a5b4ccd0c1 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 13 Jul 2015 08:22:09 +0000 Subject: Apply fixes suggested by Colin Booth --- doc/index.html | 2 +- doc/s6-rc.html | 9 ++++++--- src/s6-rc/s6-rc-db.c | 3 ++- src/s6-rc/s6-rc.c | 1 + 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/doc/index.html b/doc/index.html index 543b4ca..6f6c0ad 100644 --- a/doc/index.html +++ b/doc/index.html @@ -110,7 +110,7 @@ the previous versions of s6-rc and the current one.
  • The s6-rc-init program
  • The s6-rc program
  • The s6-rc-dryrun internal program
  • -
  • The s6-rc-upgrade program
  • +
  • The s6-rc-update program
  • Related resources

    diff --git a/doc/s6-rc.html b/doc/s6-rc.html index ff18362..8d976d6 100644 --- a/doc/s6-rc.html +++ b/doc/s6-rc.html @@ -43,7 +43,7 @@ change.
          s6-rc help
    -     s6-rc [ -l live ] [ -a ] list servicenames...
    +     s6-rc [ -l live ] [ -a ] [ -u | -d ] list servicenames...
          s6-rc [ -l live ] [ -a ] [ -u | -d ] listall servicenames...
          s6-rc [ -l live ] [ -a ] [ -u | -d ] [ -p ] [ -v verbosity ] [ -n dryrunthrottle ] [ -t timeout ] change [ servicenames... ]
     
    @@ -137,12 +137,15 @@ all brought down, then the wanted services are all brought up.

    s6-rc list servicenames...

    - Prints the selection. + Prints the selection. If the -d option has been given, +the selection is inverted before it is printed, i.e. all the +services but servicenames... will be printed.

    This is mostly useful as s6-rc -a list, which simply prints -the list of currently active services. +the list of currently active services. s6-rc -da list +will print the list of currently down services.

    s6-rc listall servicenames...

    diff --git a/src/s6-rc/s6-rc-db.c b/src/s6-rc/s6-rc-db.c index e6b5e8c..8cfe5b9 100644 --- a/src/s6-rc/s6-rc-db.c +++ b/src/s6-rc/s6-rc-db.c @@ -50,7 +50,8 @@ static void print_bundle_contents (char const *name) strerr_dief2x(4, "invalid database in ", compiled) ; if (!str_diff(name, db->string + db->services[x].name)) strerr_dief5x(1, "in database ", compiled, ": identifier ", name, " represents an atomic service") ; - if (buffer_puts(buffer_1, db->string + db->services[x].name) < 0) + if (buffer_puts(buffer_1, db->string + db->services[x].name) < 0 + || buffer_put(buffer_1, "\n", 1) < 0) strerr_diefu1sys(111, "write to stdout") ; } else diff --git a/src/s6-rc/s6-rc.c b/src/s6-rc/s6-rc.c index eaaf036..4cb68b6 100644 --- a/src/s6-rc/s6-rc.c +++ b/src/s6-rc/s6-rc.c @@ -516,6 +516,7 @@ int main (int argc, char const *const *argv) if (what == 1) { + if (!up) invert_selection() ; print_services() ; return 0 ; } -- cgit v1.3.1