Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/runit/runsv.c


Ignore:
Timestamp:
Jan 1, 2014, 12:47:38 AM (10 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.21.1
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi-busybox/runit/runsv.c

    r2725 r3232  
    2828/* Busyboxed by Denys Vlasenko <vda.linux@googlemail.com> */
    2929/* TODO: depends on runit_lib.c - review and reduce/eliminate */
     30
     31//usage:#define runsv_trivial_usage
     32//usage:       "DIR"
     33//usage:#define runsv_full_usage "\n\n"
     34//usage:       "Start and monitor a service and optionally an appendant log service"
    3035
    3136#include <sys/poll.h>
     
    140145}
    141146
    142 /* libbb candidate */
    143 static char *bb_stpcpy(char *p, const char *to_add)
    144 {
    145     while ((*p = *to_add) != '\0') {
    146         p++;
    147         to_add++;
    148     }
    149     return p;
    150 }
    151 
    152147static int open_trunc_or_warn(const char *name)
    153148{
     
    178173        close(fd);
    179174        if (rename_or_warn("supervise/pid.new",
    180             s->islog ? "log/supervise/pid" : "log/supervise/pid"+4))
     175                s->islog ? "log/supervise/pid" : "log/supervise/pid"+4))
    181176            return;
    182177        pidchanged = 0;
     
    193188        switch (s->state) {
    194189        case S_DOWN:
    195             p = bb_stpcpy(p, "down");
     190            p = stpcpy(p, "down");
    196191            break;
    197192        case S_RUN:
    198             p = bb_stpcpy(p, "run");
     193            p = stpcpy(p, "run");
    199194            break;
    200195        case S_FINISH:
    201             p = bb_stpcpy(p, "finish");
     196            p = stpcpy(p, "finish");
    202197            break;
    203198        }
    204199        if (s->ctrl & C_PAUSE)
    205             p = bb_stpcpy(p, ", paused");
     200            p = stpcpy(p, ", paused");
    206201        if (s->ctrl & C_TERM)
    207             p = bb_stpcpy(p, ", got TERM");
     202            p = stpcpy(p, ", got TERM");
    208203        if (s->state != S_DOWN)
    209204            switch (s->sd_want) {
    210205            case W_DOWN:
    211                 p = bb_stpcpy(p, ", want down");
     206                p = stpcpy(p, ", want down");
    212207                break;
    213208            case W_EXIT:
    214                 p = bb_stpcpy(p, ", want exit");
     209                p = stpcpy(p, ", want exit");
    215210                break;
    216211            }
Note: See TracChangeset for help on using the changeset viewer.