Update to killproc 2.23

OBS-URL: https://build.opensuse.org/package/show/Base:System/sysvinit?expand=0&rev=239
This commit is contained in:
Dr. Werner Fink 2019-08-29 13:29:34 +00:00 committed by Git OBS Bridge
parent 5c9ffe964c
commit 40ed02035c
8 changed files with 13 additions and 129 deletions

View File

@ -1,11 +0,0 @@
--- startproc.c
+++ startproc.c 2014-05-27 12:08:10.498235871 +0000
@@ -624,7 +624,7 @@ static int do_start(const char *inname,
char * redirect;
if (!(redirect = getenv("REDIRECT")))
redirect = "/dev/tty";
- if ((tty = open(redirect,O_WRONLY|O_NONBLOCK,0)) < 0)
+ if ((tty = open(redirect,O_RDWR|O_NONBLOCK,0)) < 0)
error(LSB_PROOF," cannot open %s: %s\n", redirect, strerror(errno));
dup2(tty, fileno(stdin));
dup2(tty, fileno(stdout));

View File

@ -1,62 +0,0 @@
---
Makefile | 6 ++----
libinit.c | 7 ++++---
startproc.c | 4 ++--
3 files changed, 8 insertions(+), 9 deletions(-)
--- Makefile
+++ Makefile 2016-01-25 15:42:08.730864821 +0000
@@ -15,10 +15,8 @@ DESTDIR =
VERSION = 2.21
DATE = $(shell date +'%d%b%y' | tr '[:lower:]' '[:upper:]')
-ifneq ($(INC),)
- LIBS += -lblogger
- COPTS += -DUSE_BLOGD
-endif
+ LIBS += -lblogger -lpthread
+ COPTS += -DUSE_BLOGD
#
# Architecture
--- libinit.c
+++ libinit.c 2016-10-04 13:22:04.272083140 +0000
@@ -265,7 +265,7 @@ static inline boolean isnetfs(const char
static void init_mounts(void)
{
char point[PATH_MAX+1];
- char fstype[126];
+ char fstype[257];
struct stat st;
int mid, parid, max = 0;
uint maj, min;
@@ -280,7 +280,7 @@ static void init_mounts(void)
if ((mnt = fopen("/proc/self/mountinfo", "re")) == (FILE*)0)
return;
- while (fscanf(mnt, "%i %i %u:%u %*s %s %*s - %*s %s %*[^\n]", &mid, &parid, &maj, &min, &point[0], &fstype[0]) == 6) {
+ while (fscanf(mnt, "%i %i %u:%u %*s %s %*s - %s %*s %*[^\n]", &mid, &parid, &maj, &min, &point[0], &fstype[0]) == 6) {
const size_t nlen = strlen(point);
MNTINFO *restrict p;
if (posix_memalign((void*)&p, sizeof(void*), alignof(MNTINFO)+(nlen+1)) != 0) {
@@ -626,7 +626,8 @@ static pid_t getsession(const pid_t pid)
{
pid_t session = getsid(pid);
if ((long)session < 0) {
- warn("can not get session id for process %ld!\n", (long)pid);
+ if (errno != ESRCH)
+ warn("can not get session id for process %ld!\n", (long)pid);
session = 1;
}
return session;
--- startproc.c
+++ startproc.c 2014-05-27 12:08:10.000000000 +0000
@@ -778,7 +778,7 @@ retry:
* to see a process damage.
*/
usleep(10*1000); /* 10 ms time for the child and its child */
- if (++n < 10)
+ if (++n < 50)
goto retry;
break;
default:

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:359ffe52eaf1f510d6581cba5d799a3926d8e1f202ddf0d76c20a1c6603e2659
size 44469

BIN
killproc-2.23.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -1,18 +0,0 @@
On newer kernels there are more optional parameter fields
before the hyphen
---
libinit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- libinit.c
+++ libinit.c 2019-04-09 12:47:35.913748799 +0000
@@ -281,7 +281,7 @@ static void init_mounts(void)
if ((mnt = fopen("/proc/self/mountinfo", "re")) == (FILE*)0)
return;
- while (fscanf(mnt, "%i %i %u:%u %*s %s %*s - %s %*s %*[^\n]", &mid, &parid, &maj, &min, &point[0], &fstype[0]) == 6) {
+ while (fscanf(mnt, "%i %i %u:%u %*s %s %*[^-] - %s %*s %*[^\n]", &mid, &parid, &maj, &min, &point[0], &fstype[0]) == 6) {
const size_t nlen = strlen(point);
MNTINFO *restrict p;
if (posix_memalign((void*)&p, sizeof(void*), alignof(MNTINFO)+(nlen+1)) != 0) {

View File

@ -1,24 +0,0 @@
Index: killproc-2.21/libinit.c
===================================================================
--- killproc-2.21.orig/libinit.c
+++ killproc-2.21/libinit.c
@@ -23,6 +23,7 @@
*/
#include <sys/mount.h>
+#include <sys/sysmacros.h>
#include "libinit.h" /* Now get the inlined functions */
#ifndef INITDIR
# define INITDIR "/etc/init.d"
Index: killproc-2.21/rvmtab.c
===================================================================
--- killproc-2.21.orig/rvmtab.c
+++ killproc-2.21/rvmtab.c
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
+#include <sys/sysmacros.h>
#include <sys/stat.h>
#include <unistd.h>
#include "libinit.h"

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Aug 29 13:25:34 UTC 2019 - Dr. Werner Fink <werner@suse.de>
- Update to killproc 2.23
* killproc has its upstream at https://github.com/bitstreamout/killproc
* Use new system call statx(2) to replace old stat(2)/lstat(2)
-------------------------------------------------------------------
Fri Jun 21 07:20:38 UTC 2019 - Dr. Werner Fink <werner@suse.de>

View File

@ -17,7 +17,7 @@
Name: sysvinit
%define KPVER 2.21
%define KPVER 2.23
%define SCVER 1.20
%define SIVER 2.95
%define START 0.63
@ -31,15 +31,11 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build
#!BuildIgnore: sysvinit-tools
Url: https://savannah.nongnu.org/projects/sysvinit/
Source: sysvinit-%{SIVER}.tar.xz
Source1: killproc-%{KPVER}.tar.bz2
Source1: https://github.com/bitstreamout/killproc/archive/v%{KPVER}.tar.gz#/killproc-%{KPVER}.tar.gz
Source2: startpar-%{START}.tar.xz
Patch: %{name}-2.90.dif
Patch2: %{name}-2.88dsf-suse.patch
Patch9: %{name}-2.90-no-kill.patch
Patch30: killproc-%{KPVER}.dif
Patch31: killproc-2.18-open_flags.dif
Patch32: killproc-sysmacros.patch
Patch33: killproc-mntinf-optional.patch
Patch50: startpar-0.58.dif
Patch51: startpar-sysmacros.patch
@ -76,11 +72,7 @@ pushd doc
mkdir killproc
popd
pushd ../killproc-%{KPVER}
%patch30
%patch31 -p0 -b .dialog
%patch32 -p1
%patch33 -p0
ln -t../%{name}-%{SIVER}/doc/killproc README
ln -t../%{name}-%{SIVER}/doc/killproc README.md
popd
pushd ../startpar-%{START}
%patch50