summaryrefslogtreecommitdiff
path: root/crux-patch.diff
blob: aba20f9adda81a7009ad3560309676e6818dee32 (plain)
    1 diff --git a/start-stop-daemon.8 b/start-stop-daemon.8
    2 index de2d35c..c370bbe 100644
    3 --- a/start-stop-daemon.8
    4 +++ b/start-stop-daemon.8
    5 @@ -20,7 +20,7 @@
    6  .\" You should have received a copy of the GNU General Public License
    7  .\" along with this program.  If not, see <https://www.gnu.org/licenses/>.
    8  .
    9 -.TH start\-stop\-daemon 8 "2017-07-04" "Debian Project" "dpkg suite"
   10 +.TH start\-stop\-daemon 8 "2018-08-11" "CRUX 3.4" "core services"
   11  .nh
   12  .SH NAME
   13  start\-stop\-daemon \- start and stop system daemon programs
   14 diff --git a/start-stop-daemon.c b/start-stop-daemon.c
   15 index e972042..35b79ee 100644
   16 --- a/start-stop-daemon.c
   17 +++ b/start-stop-daemon.c
   18 @@ -20,10 +20,34 @@
   19   * Changes by Ian Jackson: added --retry (and associated rearrangements).
   20   */
   21  
   22 +#if 0
   23  #include <config.h>
   24  #include <compat.h>
   25  
   26  #include <dpkg/macros.h>
   27 +#else
   28 +# define VERSION 		"20180811"
   29 +# define CRUX 			"CRUX 3.4"
   30 +
   31 +# define HAVE_SYS_PARAM_H
   32 +# define HAVE_SYS_SYSCALL_H
   33 +# define HAVE_SYS_SYSCTL_H
   34 +# define HAVE_SYS_USER_H
   35 +# define HAVE_STDDEF_H
   36 +# define HAVE_ERROR_H
   37 +# define HAVE_ERR_H
   38 +
   39 +# define HAVE_CLOCK_MONOTONIC
   40 +# define HAVE_GETDTABLESIZE
   41 +# define HAVE_IOPRIO_SET
   42 +# define HAVE_SETSID
   43 +
   44 +# define DPKG_ATTR_NORET	__attribute__((noreturn))
   45 +# define DPKG_ATTR_PRINTF(X)
   46 +
   47 +# define _GNU_SOURCE
   48 +# include <unistd.h>
   49 +#endif
   50  
   51  #if defined(__linux__)
   52  #  define OS_Linux
   53 @@ -158,6 +182,10 @@
   54  #define HAVE_IOPRIO_SET
   55  #endif
   56  
   57 +#ifndef array_count
   58 +# define array_count(x) 	(sizeof(x) / sizeof((x)[0]))
   59 +#endif
   60 +
   61  #define IOPRIO_CLASS_SHIFT 13
   62  #define IOPRIO_PRIO_VALUE(class, prio) (((class) << IOPRIO_CLASS_SHIFT) | (prio))
   63  #define IO_SCHED_PRIO_MIN 0
   64 @@ -345,8 +373,7 @@ xstrndup(const char *str, size_t n)
   65  static void
   66  timespec_gettime(struct timespec *ts)
   67  {
   68 -#if defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0 && \
   69 -    defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK > 0
   70 +#ifdef HAVE_CLOCK_MONOTONIC
   71  	if (clock_gettime(CLOCK_MONOTONIC, ts) < 0)
   72  		fatal("clock_gettime failed");
   73  #else
   74 @@ -664,9 +691,9 @@ usage(void)
   75  static void
   76  do_version(void)
   77  {
   78 -	printf("start-stop-daemon %s for Debian\n\n", VERSION);
   79 -
   80 -	printf("Written by Marek Michalkiewicz, public domain.\n");
   81 +	printf("start-stop-daemon " VERSION " for " CRUX "\n\n"
   82 +		"Written by Marek Michalkiewicz, public domain.\n"
   83 +		"Adjusted for " CRUX ".\n");
   84  }
   85  
   86  static void DPKG_ATTR_NORET

Generated by cgit