start-stop-daemon: update to 20150915

This commit is contained in:
Steffen Nurpmeso 2015-09-18 16:47:45 +02:00 committed by Juergen Daubert
parent 471ab7decb
commit a44edc9e8b
4 changed files with 59 additions and 24 deletions

View File

@ -1,4 +1,4 @@
4fea63328d8bd7092f524a8f19e0e721 crux-patch.diff
fc4fc999c1d7fadae2c0fd4068b56bf1 crux-patch.diff
707efd334e4ba1d5f65f366a3c03c794 makefile
c021c418059b2afcb2f501927239beca start-stop-daemon.8
1e37b936e2981abd5dfdab08e5e4cc97 start-stop-daemon.c
4e7b036a171570419127363228133bbc start-stop-daemon.c

View File

@ -3,8 +3,8 @@
# Maintainer: CRUX System Team, core-ports at crux dot nu
name=start-stop-daemon
version=20150423
release=2
version=20150915
release=1
source=(start-stop-daemon.c start-stop-daemon.8 crux-patch.diff makefile)
build () {

View File

@ -1,5 +1,5 @@
diff --git a/start-stop-daemon/start-stop-daemon.8 b/start-stop-daemon/start-stop-daemon.8
index deae6c6..c17a3dd 100644
index deae6c6..28d2de8 100644
--- a/start-stop-daemon/start-stop-daemon.8
+++ b/start-stop-daemon/start-stop-daemon.8
@@ -20,7 +20,7 @@
@ -7,12 +7,12 @@ index deae6c6..c17a3dd 100644
.\" along with this program. If not, see <https://www.gnu.org/licenses/>.
.
-.TH start\-stop\-daemon 8 "2014-03-26" "Debian Project" "dpkg utilities"
+.TH start\-stop\-daemon 8 "2015-05-11" "CRUX 3.1" "core services"
+.TH start\-stop\-daemon 8 "2015-09-15" "CRUX 3.2" "core services"
.SH NAME
start\-stop\-daemon \- start and stop system daemon programs
.
diff --git a/start-stop-daemon/start-stop-daemon.c b/start-stop-daemon/start-stop-daemon.c
index c35f448..eb5d4e6 100644
index 6d74feb..e94e482 100644
--- a/start-stop-daemon/start-stop-daemon.c
+++ b/start-stop-daemon/start-stop-daemon.c
@@ -20,10 +20,34 @@
@ -25,8 +25,8 @@ index c35f448..eb5d4e6 100644
#include <dpkg/macros.h>
+#else
+# define VERSION "20150423"
+# define CRUX "CRUX 3.1"
+# define VERSION "20150915"
+# define CRUX "CRUX 3.2"
+
+# define HAVE_SYS_PARAM_H
+# define HAVE_SYS_SYSCALL_H
@ -61,7 +61,25 @@ index c35f448..eb5d4e6 100644
#define IOPRIO_CLASS_SHIFT 13
#define IOPRIO_PRIO_VALUE(class, prio) (((class) << IOPRIO_CLASS_SHIFT) | (prio))
#define IO_SCHED_PRIO_MIN 0
@@ -310,8 +338,7 @@ xstrdup(const char *str)
@@ -297,17 +325,6 @@ xmalloc(int size)
}
static char *
-xstrdup(const char *str)
-{
- char *new_str;
-
- new_str = strdup(str);
- if (new_str)
- return new_str;
- fatal("strdup(%s) failed", str);
-}
-
-static char *
xstrndup(const char *str, size_t n)
{
char *new_str;
@@ -321,8 +338,7 @@ xstrndup(const char *str, size_t n)
static void
timespec_gettime(struct timespec *ts)
{
@ -71,7 +89,7 @@ index c35f448..eb5d4e6 100644
if (clock_gettime(CLOCK_MONOTONIC, ts) < 0)
fatal("clock_gettime failed");
#else
@@ -615,9 +642,9 @@ usage(void)
@@ -626,9 +642,9 @@ usage(void)
static void
do_version(void)
{

View File

@ -307,6 +307,17 @@ xstrdup(const char *str)
fatal("strdup(%s) failed", str);
}
static char *
xstrndup(const char *str, size_t n)
{
char *new_str;
new_str = strndup(str, n);
if (new_str)
return new_str;
fatal("strndup(%s, %zu) failed", str, n);
}
static void
timespec_gettime(struct timespec *ts)
{
@ -733,14 +744,15 @@ validate_proc_schedule(void)
static void
parse_proc_schedule(const char *string)
{
char *policy_str, *prio_str;
char *policy_str;
size_t policy_len;
int prio = 0;
policy_str = xstrdup(string);
policy_str = strtok(policy_str, ":");
prio_str = strtok(NULL, ":");
policy_len = strcspn(string, ":");
policy_str = xstrndup(string, policy_len);
if (prio_str && parse_unsigned(prio_str, 10, &prio) != 0)
if (string[policy_len] == ':' &&
parse_unsigned(string + policy_len + 1, 10, &prio) != 0)
fatal("invalid process scheduler priority");
proc_sched = xmalloc(sizeof(*proc_sched));
@ -764,14 +776,15 @@ parse_proc_schedule(const char *string)
static void
parse_io_schedule(const char *string)
{
char *class_str, *prio_str;
char *class_str;
size_t class_len;
int prio = 4;
class_str = xstrdup(string);
class_str = strtok(class_str, ":");
prio_str = strtok(NULL, ":");
class_len = strcspn(string, ":");
class_str = xstrndup(string, class_len);
if (prio_str && parse_unsigned(prio_str, 10, &prio) != 0)
if (string[class_len] == ':' &&
parse_unsigned(string + class_len + 1, 10, &prio) != 0)
fatal("invalid IO scheduler priority");
io_sched = xmalloc(sizeof(*io_sched));
@ -970,6 +983,7 @@ parse_options(int argc, char * const *argv)
const char *schedule_str = NULL;
const char *proc_schedule_str = NULL;
const char *io_schedule_str = NULL;
size_t changeuser_len;
int c;
for (;;) {
@ -1033,9 +1047,12 @@ parse_options(int argc, char * const *argv)
case 'c': /* --chuid <username>|<uid> */
/* We copy the string just in case we need the
* argument later. */
changeuser = xstrdup(optarg);
changeuser = strtok(changeuser, ":");
changegroup = strtok(NULL, ":");
changeuser_len = strcspn(optarg, ":");
changeuser = xstrndup(optarg, changeuser_len);
if (optarg[changeuser_len] == ':' &&
optarg[changeuser_len + 1] == '\0')
fatal("missing group name");
changegroup = optarg + changeuser_len + 1;
break;
case 'g': /* --group <group>|<gid> */
changegroup = optarg;