Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/runit/runsv.c


Ignore:
Timestamp:
Dec 20, 2016, 4:07:32 PM (7 years ago)
Author:
Bruno Cornec
Message:

New 3?3 banch for incorporation of latest busybox 1.25. Changing minor version to handle potential incompatibilities.

Location:
branches/3.3
Files:
1 edited
1 copied

Legend:

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

    r3232 r3621  
    2727
    2828/* Busyboxed by Denys Vlasenko <vda.linux@googlemail.com> */
    29 /* TODO: depends on runit_lib.c - review and reduce/eliminate */
     29
     30//config:config RUNSV
     31//config:   bool "runsv"
     32//config:   default y
     33//config:   help
     34//config:     runsv starts and monitors a service and optionally an appendant log
     35//config:     service.
     36
     37//applet:IF_RUNSV(APPLET(runsv, BB_DIR_USR_BIN, BB_SUID_DROP))
     38
     39//kbuild:lib-$(CONFIG_RUNSV) += runsv.o
    3040
    3141//usage:#define runsv_trivial_usage
     
    3444//usage:       "Start and monitor a service and optionally an appendant log service"
    3545
    36 #include <sys/poll.h>
    3746#include <sys/file.h>
    3847#include "libbb.h"
     48#include "common_bufsiz.h"
    3949#include "runit_lib.h"
    4050
     
    5161static void gettimeofday_ns(struct timespec *ts)
    5262{
    53     if (sizeof(struct timeval) == sizeof(struct timespec)
    54      && sizeof(((struct timeval*)ts)->tv_usec) == sizeof(ts->tv_nsec)
    55     ) {
    56         /* Cheat */
    57         gettimeofday((void*)ts, NULL);
    58         ts->tv_nsec *= 1000;
    59     } else {
    60         extern void BUG_need_to_implement_gettimeofday_ns(void);
    61         BUG_need_to_implement_gettimeofday_ns();
    62     }
     63    BUILD_BUG_ON(sizeof(struct timeval) != sizeof(struct timespec));
     64    BUILD_BUG_ON(sizeof(((struct timeval*)ts)->tv_usec) != sizeof(ts->tv_nsec));
     65    /* Cheat */
     66    gettimeofday((void*)ts, NULL);
     67    ts->tv_nsec *= 1000;
    6368}
    6469#endif
     
    102107    struct svdir svd[2];
    103108} FIX_ALIASING;
    104 #define G (*(struct globals*)&bb_common_bufsiz1)
     109#define G (*(struct globals*)bb_common_bufsiz1)
    105110#define haslog       (G.haslog      )
    106111#define sigterm      (G.sigterm     )
     
    111116#define svd          (G.svd         )
    112117#define INIT_G() do { \
     118    setup_common_bufsiz(); \
    113119    pidchanged = 1; \
    114120} while (0)
     
    116122static void fatal2_cannot(const char *m1, const char *m2)
    117123{
    118     bb_perror_msg_and_die("%s: fatal: cannot %s%s", dir, m1, m2);
     124    bb_perror_msg_and_die("%s: fatal: can't %s%s", dir, m1, m2);
    119125    /* was exiting 111 */
    120126}
     
    126132static void fatal2x_cannot(const char *m1, const char *m2)
    127133{
    128     bb_error_msg_and_die("%s: fatal: cannot %s%s", dir, m1, m2);
     134    bb_error_msg_and_die("%s: fatal: can't %s%s", dir, m1, m2);
    129135    /* was exiting 111 */
    130136}
Note: See TracChangeset for help on using the changeset viewer.