Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/runit/runsv.c
- Timestamp:
- Dec 20, 2016, 4:07:32 PM (7 years ago)
- Location:
- branches/3.3
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mindi-busybox/runit/runsv.c
r3232 r3621 27 27 28 28 /* 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 30 40 31 41 //usage:#define runsv_trivial_usage … … 34 44 //usage: "Start and monitor a service and optionally an appendant log service" 35 45 36 #include <sys/poll.h>37 46 #include <sys/file.h> 38 47 #include "libbb.h" 48 #include "common_bufsiz.h" 39 49 #include "runit_lib.h" 40 50 … … 51 61 static void gettimeofday_ns(struct timespec *ts) 52 62 { 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; 63 68 } 64 69 #endif … … 102 107 struct svdir svd[2]; 103 108 } FIX_ALIASING; 104 #define G (*(struct globals*) &bb_common_bufsiz1)109 #define G (*(struct globals*)bb_common_bufsiz1) 105 110 #define haslog (G.haslog ) 106 111 #define sigterm (G.sigterm ) … … 111 116 #define svd (G.svd ) 112 117 #define INIT_G() do { \ 118 setup_common_bufsiz(); \ 113 119 pidchanged = 1; \ 114 120 } while (0) … … 116 122 static void fatal2_cannot(const char *m1, const char *m2) 117 123 { 118 bb_perror_msg_and_die("%s: fatal: can not %s%s", dir, m1, m2);124 bb_perror_msg_and_die("%s: fatal: can't %s%s", dir, m1, m2); 119 125 /* was exiting 111 */ 120 126 } … … 126 132 static void fatal2x_cannot(const char *m1, const char *m2) 127 133 { 128 bb_error_msg_and_die("%s: fatal: can not %s%s", dir, m1, m2);134 bb_error_msg_and_die("%s: fatal: can't %s%s", dir, m1, m2); 129 135 /* was exiting 111 */ 130 136 }
Note:
See TracChangeset
for help on using the changeset viewer.