Hello community,
here is the log from the commit of package sysvinit for openSUSE:Factory
checked in at Mon Sep 5 17:54:44 CEST 2011.
--------
--- sysvinit/sysvinit.changes 2011-08-01 16:48:32.000000000 +0200
+++ /mounts/work_src_done/STABLE/sysvinit/sysvinit.changes 2011-09-02 17:44:26.000000000 +0200
@@ -1,0 +2,7 @@
+Fri Sep 2 15:43:20 UTC 2011 - werner@suse.de
+
+- Update to killproc-2.20
+- Update to showconsole-1.15
+- Clean spec file
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
killproc-2.19.dif
killproc-2.19.tar.bz2
showconsole-1.14.dif
showconsole-1.14.tar.bz2
New:
----
killproc-2.20.dif
killproc-2.20.tar.bz2
showconsole-1.15.dif
showconsole-1.15.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ sysvinit.spec ++++++
--- /var/tmp/diff_new_pack.XKBXyu/_old 2011-09-05 17:54:28.000000000 +0200
+++ /var/tmp/diff_new_pack.XKBXyu/_new 2011-09-05 17:54:28.000000000 +0200
@@ -21,23 +21,23 @@
Name: sysvinit
%define MGVER 0.9.6s
%define PDVER 2.0.2
-%define KPVER 2.19
-%define SCVER 1.14
+%define KPVER 2.20
+%define SCVER 1.15
%define SIVER 2.88+
%define START 0.57
License: GPLv2+
Group: System/Base
AutoReqProv: on
Version: 2.88+
-Release: 58
+Release: 60
Summary: SysV-Style init
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: audit-devel libselinux-devel libsepol-devel pam-devel
Url: http://savannah.nongnu.org/projects/sysvinit/
Source: http://download.savannah.gnu.org/releases/sysvinit/sysvinit-2.88+dsf.tar.bz2
-Source2: killproc-2.19.tar.bz2
+Source2: killproc-2.20.tar.bz2
Source3: powerd-2.0.2.tar.bz2
-Source4: showconsole-1.14.tar.bz2
+Source4: showconsole-1.15.tar.bz2
Source5: startpar-0.57.tar.bz2
Source6: rc.powerd
Source7: sysvinit-rpmlintrc
@@ -55,8 +55,8 @@
Patch8: sysvinit-2.88+dsf-blowfish.dif
Patch20: powerd-2.0.2.dif
Patch21: powerd-2.0.2-getaddrinfo.patch
-Patch30: killproc-2.19.dif
-Patch40: showconsole-1.14.dif
+Patch30: killproc-2.20.dif
+Patch40: showconsole-1.15.dif
Patch50: startpar-0.57.dif
Requires: sysvinit-tools
Provides: sbin_init
@@ -98,15 +98,21 @@
%patch7 -p0 -b .crypt
%patch8 -p0 -b .blowfish
%patch
+pushd doc
+ mkdir killproc powerd showconsole
+popd
pushd ../powerd-%{PDVER}
%patch20
%patch21
+ln -t ../sysvinit-%{SIVER}dsf/doc/powerd README SUPPORTED FAQ powerd.conf.monitor powerd.conf.peer
popd
pushd ../killproc-%{KPVER}
%patch30
+ln -t ../sysvinit-%{SIVER}dsf/doc/killproc README
popd
pushd ../showconsole-%{SCVER}
%patch40
+ln -t ../sysvinit-%{SIVER}dsf/doc/showconsole README
popd
pushd ../startpar-%{START}
%patch50
@@ -165,9 +171,6 @@
pushd ../powerd-%{PDVER}
%ifnarch s390 s390x
make install DESTDIR=${RPM_BUILD_ROOT}
- cp README README.powerd
- cp SUPPORTED SUPPORTED.powerd
- cp FAQ FAQ.powerd
echo '# ' > ${RPM_BUILD_ROOT}/etc/powerd.conf
echo '# /etc/powerd.conf for powerd version-2.02' >> ${RPM_BUILD_ROOT}/etc/powerd.conf
echo '# ' >> ${RPM_BUILD_ROOT}/etc/powerd.conf
@@ -247,16 +250,13 @@
%files tools
%defattr (-,root,root,755)
+%doc COPYING COPYRIGHT doc/Propaganda
+%doc doc/Changelog doc/killproc doc/showconsole
%ifnarch s390 s390x
%config /etc/powerd.conf
%config /etc/init.d/powerd
-%doc ../powerd-%{PDVER}/README.powerd
-%doc ../powerd-%{PDVER}/SUPPORTED.powerd
-%doc ../powerd-%{PDVER}/FAQ.powerd
-%doc ../powerd-%{PDVER}/powerd.conf.monitor
-%doc ../powerd-%{PDVER}/powerd.conf.peer
+%doc doc/powerd
%endif
-# %doc contrib/bootlogd.README
%dir /lib/mkinitrd
%dir /lib/mkinitrd/scripts
/lib/mkinitrd/scripts/boot-blogd.sh
@@ -269,8 +269,6 @@
/usr/bin/last
/usr/bin/lastb
/usr/bin/utmpdump
-# /sbin/bootlogd
-# /sbin/intr
/sbin/blogger
/sbin/blogd
/sbin/fstab-decode
@@ -301,7 +299,6 @@
# /usr/lib/libblogger.a
%doc %{_mandir}/man1/mountpoint.1.gz
%doc %{_mandir}/man1/utmpdump.1.gz
-# %doc %{_mandir}/man8/bootlogd.8.gz
%doc %{_mandir}/man8/blogger.8.gz
%doc %{_mandir}/man8/blogd.8.gz
%doc %{_mandir}/man8/fstab-decode.8.gz
@@ -310,7 +307,6 @@
%doc %{_mandir}/man8/isserial.8.gz
%doc %{_mandir}/man8/checkproc.8.gz
%doc %{_mandir}/man8/pidofproc.8.gz
-#%doc %{_mandir}/man8/intr.8.gz
%doc %{_mandir}/man8/killall5.8.gz
%doc %{_mandir}/man8/killproc.8.gz
%doc %{_mandir}/man8/pidof.8.gz
@@ -325,5 +321,12 @@
%doc %{_mandir}/man8/rvmtab.8.gz
%doc %{_mandir}/man8/vhangup.8.gz
%doc %{_mandir}/man8/mkill.8.gz
+%if 0
+%doc contrib/bootlogd.README
+/sbin/bootlogd
+/sbin/intr
+%doc %{_mandir}/man8/bootlogd.8.gz
+%doc %{_mandir}/man8/intr.8.gz
+%endif
%changelog
++++++ killproc-2.19.dif -> killproc-2.20.dif ++++++
--- sysvinit/killproc-2.19.dif 2011-04-15 16:49:21.000000000 +0200
+++ /mounts/work_src_done/STABLE/sysvinit/killproc-2.20.dif 2011-09-02 17:44:25.000000000 +0200
@@ -1,191 +1,4 @@
---- libinit.c
-+++ libinit.c 2011-04-06 13:21:49.212425737 +0000
-@@ -349,18 +349,24 @@ static int find_mount(const char * path,
- {
- const size_t nlen = strlen(path);
- list_t *ptr;
-+ int ret = 0;
-
- list_for_each(ptr, &mounts) {
- MNTINFO *m = list_entry(ptr, MNTINFO);
- if (nlen < m->nlen)
- continue;
-- if (m->nlen == 1) /* root fs is the last entry */
-- return (m == s);
-+ if (m->nlen == 1 && (m == s)) { /* root fs is the last entry */
-+ ret++;
-+ break;
-+ }
- if (strncmp(path, m->point, m->nlen))
- continue;
-- return (m == s);
-+ if (m == s) {
-+ ret++;
-+ break;
-+ }
- }
-- return 0;
-+ return ret;
- }
-
- extern inline char * handl_buf(char *restrict buf)
-@@ -669,6 +675,7 @@ int pidof (const char * inname, const ch
- boolean isscrpt = false;
- unsigned num = 0;
- pid_t pid;
-+ uid_t uid;
- char *swapname = NULL;
- char *fullname = (char *)inname;
- char *realname = NULL;
-@@ -677,6 +684,7 @@ int pidof (const char * inname, const ch
-
- p_pid = getpid();
- p_ppid = getppid();
-+ uid = getuid();
-
- dir = openproc(); /* Open /proc and maybe do mount before */
- p_pppid = getpppid(p_ppid); /* Requires existence of /proc */
-@@ -773,6 +781,13 @@ int pidof (const char * inname, const ch
-
- if (prefix) {
- if ((rll = readlinkat(dfd, here(d->d_name, "exe"), entry, PATH_MAX)) < 0) {
-+ if (uid && (errno == EACCES || errno == EPERM)) {
-+ errno = 0;
-+ if (fstatat(dfd, d->d_name, &pid_st, 0) < 0)
-+ continue;
-+ if (pid_st.st_uid == uid)
-+ goto risky;
-+ }
- if (errno != EPERM && errno != EACCES)
- goto risky;
- continue;
-@@ -809,6 +824,13 @@ int pidof (const char * inname, const ch
-
- if (!name) {
- if ((rll = readlinkat(dfd, here(d->d_name, "exe"), entry, PATH_MAX)) < 0) {
-+ if (uid && (errno == EACCES || errno == EPERM)) {
-+ errno = 0;
-+ if (fstatat(dfd, d->d_name, &pid_st, 0) < 0)
-+ continue;
-+ if (pid_st.st_uid == uid)
-+ goto risky;
-+ }
- if (errno != EPERM && errno != EACCES)
- goto risky;
- continue;
-@@ -825,7 +847,6 @@ int pidof (const char * inname, const ch
- if (realname && strncmp(realname, name, PATH_MAX) == 0)
- found = true;
-
--
- break;
- }
-
-@@ -942,12 +963,15 @@ int verify_pidfile (const char * pid_fil
- ssize_t cnt;
- boolean isscrpt = false;
- pid_t pid;
-+ uid_t uid;
- char *swapname = NULL, *bufp;
- char *fullname = (char *)inname;
- char *realname = NULL;
- struct stat pid_st, full_st;
- char buf[BUFSIZ];
-
-+ uid = getuid();
-+
- if (!ignore) {
- list_t *m, *n;
- list_for_each_safe(m, n, &remember) {
-@@ -1041,14 +1065,23 @@ int verify_pidfile (const char * pid_fil
- }
-
- errno = 0;
-- if (!(flags & (KTHREAD|KSHORT)) && !isscrpt &&
-- (stat(proc(buf, "exe"), &pid_st) == 0)) {
--
-+ if (!(flags & (KTHREAD|KSHORT)) && !isscrpt) {
- char entry[PATH_MAX+1];
- const char *name;
- boolean found;
- ssize_t rll;
-
-+ if (stat(proc(buf, "exe"), &pid_st) < 0) {
-+ if (uid && (errno == EACCES || errno == EPERM)) {
-+ errno = 0;
-+ if (stat(proc(buf, ""), &pid_st) < 0)
-+ goto out;
-+ if (pid_st.st_uid == uid)
-+ goto risky;
-+ }
-+ goto out;
-+ }
-+
- if (pid_st.st_dev != full_st.st_dev)
- goto out;
-
-@@ -1087,6 +1120,7 @@ int verify_pidfile (const char * pid_fil
-
- goto out;
- }
-+risky:
-
- if (errno && errno != ENOENT) {
- warn("Can not read %s: %s\n", procbuf, strerror(errno));
-@@ -1162,8 +1196,11 @@ int check_pids (const char * inname, con
- const char *pid;
- struct stat pid_st, full_st;
- list_t *m, *n;
-+ uid_t uid;
- int fp;
-
-+ uid = getuid();
-+
- if (!fullname) {
- warn("program or process name required\n");
- return -1;
-@@ -1228,13 +1265,22 @@ int check_pids (const char * inname, con
-
- /* killproc and daemon/startproc should use the full path */
- errno = 0;
-- if (!(flags & (KTHREAD|KSHORT)) && !isscrpt &&
-- (stat(proc(pid, "exe"), &pid_st) == 0)) {
--
-+ if (!(flags & (KTHREAD|KSHORT)) && !isscrpt) {
- char entry[PATH_MAX+1];
- const char *name;
- ssize_t rll;
-
-+ if (stat(proc(pid, "exe"), &pid_st) < 0) {
-+ if (uid && (errno == EACCES || errno == EPERM)) {
-+ errno = 0;
-+ if (stat(proc(pid, ""), &pid_st) < 0)
-+ goto ignore;
-+ if (pid_st.st_uid == uid)
-+ goto risky;
-+ }
-+ goto ignore;
-+ }
-+
- if (pid_st.st_dev != full_st.st_dev)
- goto ignore; /* Does not belong to rembered list */
-
-@@ -1267,6 +1313,7 @@ int check_pids (const char * inname, con
-
- skip = true; /* No stat entry check needed */
- }
-+risky:
-
- if (!(flags & (KTHREAD|KSHORT)) && isscrpt &&
- (fp = open(proc(pid, "cmdline"), O_PROCMODE)) != -1) {
---- libinit.h
-+++ libinit.h 2011-04-15 14:43:35.083926074 +0000
-@@ -91,7 +91,7 @@
- #define WRGSYNTAX 102 /* usage etc. */
- #define NOPIDREAD 101 /* trouble */
-
--#define LSB_STATUS_PROOF ((errno == EPERM || errno == EACCES) ? LSB_NOPERM : NOPIDREAD )
-+#define LSB_STATUS_PROOF ((errno == EPERM || errno == EACCES) ? LSB_NOPERM : LSB_STATUS_ISDEAD )
- #define LSB_STATUS_PROOFX ((errno == ENOENT) ? (flags & KILL) ? LSB_NOENTR : 4 : LSB_STATUS_PROOF )
-
- #define LOG_OPTIONS (LOG_ODELAY|LOG_CONS)
+--- .#nothing
++++ .#nothing 2011-09-01 11:59:52.000000000 +0000
+@@ -0,0 +1 @@
++Please remove if patched
++++++ killproc-2.19.tar.bz2 -> killproc-2.20.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/killproc-2.19/Makefile new/killproc-2.20/Makefile
--- old/killproc-2.19/Makefile 2011-02-16 09:04:59.000000000 +0100
+++ new/killproc-2.20/Makefile 2011-09-02 16:42:22.000000000 +0200
@@ -12,7 +12,7 @@
PREFIX = /usr
DEBUG =
DESTDIR =
-VERSION = 2.19
+VERSION = 2.20
DATE = $(shell date +'%d%b%y' | tr '[:lower:]' '[:upper:]')
ifneq ($(INC),)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/killproc-2.19/checkproc.8 new/killproc-2.20/checkproc.8
--- old/killproc-2.19/checkproc.8 2011-02-16 09:04:59.000000000 +0100
+++ new/killproc-2.20/checkproc.8 2011-09-02 16:42:22.000000000 +0200
@@ -193,7 +193,7 @@
Use an alternate pid file instead of the default
.BR /var/run/<basename>.pid .
If the option
-.b \-k
+.B \-k
is specified and the
.I pid_file
does not exist,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/killproc-2.19/fsync.1 new/killproc-2.20/fsync.1
--- old/killproc-2.19/fsync.1 2011-02-16 09:04:59.000000000 +0100
+++ new/killproc-2.20/fsync.1 2011-09-02 16:42:22.000000000 +0200
@@ -27,11 +27,11 @@
.BR fsync (2)
function and therefore shows the same weaknesses
by any system activity.
-\."
+.\"
.SH SEE ALSO
.BR fsync (2),
.BR fdatasync (2).
-\."
+.\"
.SH COPYRIGHT
2007 Werner Fink,
2007 SuSE GmbH Nuernberg, Germany.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/killproc-2.19/killproc-2.19.lsm new/killproc-2.20/killproc-2.19.lsm
--- old/killproc-2.19/killproc-2.19.lsm 2011-02-16 09:04:59.000000000 +0100
+++ new/killproc-2.20/killproc-2.19.lsm 1970-01-01 01:00:00.000000000 +0100
@@ -1,18 +0,0 @@
-Begin3
-Title: killproc and assorted tools for boot scripts
-Version: 2.19
-Entered-date: 16FEB11
-Description: Some useful programs for a replacment of the shell functions
- daemom and killproc found in the Linux System V init suite.
- killproc(8) for signaling or terminating, checkproc(8) for
- checking and startproc(8) for starting processes.
- Each program has its own manual page.
-Keywords: killproc, startproc, checkproc, process control
-Author: Werner Fink
-Maintained-by: Werner Fink
-Primary-site: sunsite.unc.edu /pub/Linux/system/daemons/init
- @UNKNOWN killproc-2.19.tar.gz
-Alternate-site: ftp.suse.com /pub/projects/init
-Platforms: Linux with System VR2 or higher boot scheme
-Copying-policy: GPL
-End
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/killproc-2.19/killproc-2.20.lsm new/killproc-2.20/killproc-2.20.lsm
--- old/killproc-2.19/killproc-2.20.lsm 1970-01-01 01:00:00.000000000 +0100
+++ new/killproc-2.20/killproc-2.20.lsm 2011-09-02 16:42:22.000000000 +0200
@@ -0,0 +1,18 @@
+Begin3
+Title: killproc and assorted tools for boot scripts
+Version: 2.20
+Entered-date: 02SEP11
+Description: Some useful programs for a replacment of the shell functions
+ daemom and killproc found in the Linux System V init suite.
+ killproc(8) for signaling or terminating, checkproc(8) for
+ checking and startproc(8) for starting processes.
+ Each program has its own manual page.
+Keywords: killproc, startproc, checkproc, process control
+Author: Werner Fink
+Maintained-by: Werner Fink
+Primary-site: sunsite.unc.edu /pub/Linux/system/daemons/init
+ @UNKNOWN killproc-2.20.tar.gz
+Alternate-site: ftp.suse.com /pub/projects/init
+Platforms: Linux with System VR2 or higher boot scheme
+Copying-policy: GPL
+End
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/killproc-2.19/libinit.c new/killproc-2.20/libinit.c
--- old/killproc-2.19/libinit.c 2011-02-16 09:04:59.000000000 +0100
+++ new/killproc-2.20/libinit.c 2011-09-02 16:42:22.000000000 +0200
@@ -349,18 +349,24 @@
{
const size_t nlen = strlen(path);
list_t *ptr;
+ int ret = 0;
list_for_each(ptr, &mounts) {
MNTINFO *m = list_entry(ptr, MNTINFO);
if (nlen < m->nlen)
continue;
- if (m->nlen == 1) /* root fs is the last entry */
- return (m == s);
+ if (m->nlen == 1 && (m == s)) { /* root fs is the last entry */
+ ret++;
+ break;
+ }
if (strncmp(path, m->point, m->nlen))
continue;
- return (m == s);
+ if (m == s) {
+ ret++;
+ break;
+ }
}
- return 0;
+ return ret;
}
extern inline char * handl_buf(char *restrict buf)
@@ -669,6 +675,7 @@
boolean isscrpt = false;
unsigned num = 0;
pid_t pid;
+ uid_t uid;
char *swapname = NULL;
char *fullname = (char *)inname;
char *realname = NULL;
@@ -677,6 +684,7 @@
p_pid = getpid();
p_ppid = getppid();
+ uid = getuid();
dir = openproc(); /* Open /proc and maybe do mount before */
p_pppid = getpppid(p_ppid); /* Requires existence of /proc */
@@ -773,6 +781,13 @@
if (prefix) {
if ((rll = readlinkat(dfd, here(d->d_name, "exe"), entry, PATH_MAX)) < 0) {
+ if (uid && (errno == EACCES || errno == EPERM)) {
+ errno = 0;
+ if (fstatat(dfd, d->d_name, &pid_st, 0) < 0)
+ continue;
+ if (pid_st.st_uid == uid)
+ goto risky;
+ }
if (errno != EPERM && errno != EACCES)
goto risky;
continue;
@@ -809,6 +824,13 @@
if (!name) {
if ((rll = readlinkat(dfd, here(d->d_name, "exe"), entry, PATH_MAX)) < 0) {
+ if (uid && (errno == EACCES || errno == EPERM)) {
+ errno = 0;
+ if (fstatat(dfd, d->d_name, &pid_st, 0) < 0)
+ continue;
+ if (pid_st.st_uid == uid)
+ goto risky;
+ }
if (errno != EPERM && errno != EACCES)
goto risky;
continue;
@@ -825,7 +847,6 @@
if (realname && strncmp(realname, name, PATH_MAX) == 0)
found = true;
-
break;
}
@@ -942,12 +963,15 @@
ssize_t cnt;
boolean isscrpt = false;
pid_t pid;
+ uid_t uid;
char *swapname = NULL, *bufp;
char *fullname = (char *)inname;
char *realname = NULL;
struct stat pid_st, full_st;
char buf[BUFSIZ];
+ uid = getuid();
+
if (!ignore) {
list_t *m, *n;
list_for_each_safe(m, n, &remember) {
@@ -1041,14 +1065,23 @@
}
errno = 0;
- if (!(flags & (KTHREAD|KSHORT)) && !isscrpt &&
- (stat(proc(buf, "exe"), &pid_st) == 0)) {
-
+ if (!(flags & (KTHREAD|KSHORT)) && !isscrpt) {
char entry[PATH_MAX+1];
const char *name;
boolean found;
ssize_t rll;
+ if (stat(proc(buf, "exe"), &pid_st) < 0) {
+ if (uid && (errno == EACCES || errno == EPERM)) {
+ errno = 0;
+ if (stat(proc(buf, ""), &pid_st) < 0)
+ goto out;
+ if (pid_st.st_uid == uid)
+ goto risky;
+ }
+ goto out;
+ }
+
if (pid_st.st_dev != full_st.st_dev)
goto out;
@@ -1087,6 +1120,7 @@
goto out;
}
+risky:
if (errno && errno != ENOENT) {
warn("Can not read %s: %s\n", procbuf, strerror(errno));
@@ -1162,8 +1196,11 @@
const char *pid;
struct stat pid_st, full_st;
list_t *m, *n;
+ uid_t uid;
int fp;
+ uid = getuid();
+
if (!fullname) {
warn("program or process name required\n");
return -1;
@@ -1228,13 +1265,22 @@
/* killproc and daemon/startproc should use the full path */
errno = 0;
- if (!(flags & (KTHREAD|KSHORT)) && !isscrpt &&
- (stat(proc(pid, "exe"), &pid_st) == 0)) {
-
+ if (!(flags & (KTHREAD|KSHORT)) && !isscrpt) {
char entry[PATH_MAX+1];
const char *name;
ssize_t rll;
+ if (stat(proc(pid, "exe"), &pid_st) < 0) {
+ if (uid && (errno == EACCES || errno == EPERM)) {
+ errno = 0;
+ if (stat(proc(pid, ""), &pid_st) < 0)
+ goto ignore;
+ if (pid_st.st_uid == uid)
+ goto risky;
+ }
+ goto ignore;
+ }
+
if (pid_st.st_dev != full_st.st_dev)
goto ignore; /* Does not belong to rembered list */
@@ -1267,6 +1313,7 @@
skip = true; /* No stat entry check needed */
}
+risky:
if (!(flags & (KTHREAD|KSHORT)) && isscrpt &&
(fp = open(proc(pid, "cmdline"), O_PROCMODE)) != -1) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/killproc-2.19/libinit.h new/killproc-2.20/libinit.h
--- old/killproc-2.19/libinit.h 2011-02-16 09:04:59.000000000 +0100
+++ new/killproc-2.20/libinit.h 2011-09-02 16:42:22.000000000 +0200
@@ -91,7 +91,7 @@
#define WRGSYNTAX 102 /* usage etc. */
#define NOPIDREAD 101 /* trouble */
-#define LSB_STATUS_PROOF ((errno == EPERM || errno == EACCES) ? LSB_NOPERM : NOPIDREAD )
+#define LSB_STATUS_PROOF ((errno == EPERM || errno == EACCES) ? LSB_NOPERM : LSB_STATUS_ISDEAD )
#define LSB_STATUS_PROOFX ((errno == ENOENT) ? (flags & KILL) ? LSB_NOENTR : 4 : LSB_STATUS_PROOF )
#define LOG_OPTIONS (LOG_ODELAY|LOG_CONS)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/killproc-2.19/mkill.8 new/killproc-2.20/mkill.8
--- old/killproc-2.19/mkill.8 2011-02-16 09:04:59.000000000 +0100
+++ new/killproc-2.20/mkill.8 2011-09-02 16:42:22.000000000 +0200
@@ -69,7 +69,7 @@
.B \fB\-l\fR
List all known signals.
.IP
-\."
+.\"
.SH EXAMPLES
.nf
.B mkill -TERM /var
@@ -85,15 +85,15 @@
.fi
All processes using a pseudo-terminal slave will
hangup.
-\."
+.\"
.SH RETURN VALUE
Always success which is that zero is returned.
-\."
+.\"
.SH SEE ALSO
.BR fuser (1),
.BR proc (5),
.BR umount (8).
-\."
+.\"
.SH COPYRIGHT
2008 Werner Fink,
2008 SUSE LINUX Products GmbH, Germany.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/killproc-2.19/rvmtab.8 new/killproc-2.20/rvmtab.8
--- old/killproc-2.19/rvmtab.8 2011-02-16 09:04:59.000000000 +0100
+++ new/killproc-2.20/rvmtab.8 2011-09-02 16:42:22.000000000 +0200
@@ -29,17 +29,17 @@
Currently
.B rvmtab
does not know about any option.
-\."
+.\"
.SH EXAMPLES
.nf
.B rvmtab
.fi
-\."
+.\"
.SH RETURN VALUE
Beside permsissions and and alloc errors
.B rvmtab
always returns success.
-\."
+.\"
.SH FILES
.TP
.I /proc/
@@ -51,10 +51,10 @@
.TP
.I /proc/self/mountinfo
this file contains information about mount points like the unique mount ID.
-\."
+.\"
.SH SEE ALSO
.BR proc (5),
-\."
+.\"
.SH COPYRIGHT
2011 Werner Fink,
2011 SUSE LINUX Products GmbH, Germany.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/killproc-2.19/usleep.1 new/killproc-2.20/usleep.1
--- old/killproc-2.19/usleep.1 2011-02-16 09:04:59.000000000 +0100
+++ new/killproc-2.20/usleep.1 2011-09-02 16:42:22.000000000 +0200
@@ -36,13 +36,13 @@
.BR usleep (3)
function and therefore shows the same weaknesses
by any system activity.
-\."
+.\"
.SH SEE ALSO
.BR usleep (3),
.BR sleep (1),
.BR sleep (3),
.BR sched_yield (2).
-\."
+.\"
.SH COPYRIGHT
2001 Werner Fink,
2001 SuSE GmbH Nuernberg, Germany.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/killproc-2.19/vhangup.8 new/killproc-2.20/vhangup.8
--- old/killproc-2.19/vhangup.8 2011-02-16 09:04:59.000000000 +0100
+++ new/killproc-2.20/vhangup.8 2011-09-02 16:42:22.000000000 +0200
@@ -20,7 +20,7 @@
.B vhangup
simulates a hangup on the specified terminals. Not existing
device files or devices will be ignored.
-\."
+.\"
.SH EXAMPLES
.nf
.B vhangup /dev/tty1 /dev/tty2 /dev/tty3 /dev/tty4 /dev/tty5 /dev/tty6 /dev/ttyS1
@@ -30,16 +30,16 @@
to the listed ttys by a dummy that will deny further reading/writing
to the device. It also send the signals SIGHUP/SIGCONT to the processes
which have file descriptors open on the listed ttys.
-\."
+.\"
.SH RETURN VALUE
On success, zero is returned. On error, 1 is returned.
-\."
+.\"
.SH SEE ALSO
.BR vhangup (2),
.BR tty (4),
.BR ttyS (4),
.BR pts (4).
-\."
+.\"
.SH COPYRIGHT
2008 Werner Fink,
2008 SUSE LINUX Products GmbH, Germany.
++++++ showconsole-1.14.dif -> showconsole-1.15.dif ++++++
++++ 690 lines (skipped)
++++ between sysvinit/showconsole-1.14.dif
++++ and /mounts/work_src_done/STABLE/sysvinit/showconsole-1.15.dif
++++++ showconsole-1.14.tar.bz2 -> showconsole-1.15.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/showconsole-1.14/Makefile new/showconsole-1.15/Makefile
--- old/showconsole-1.14/Makefile 2010-11-09 17:01:00.000000000 +0100
+++ new/showconsole-1.15/Makefile 2011-04-01 15:19:46.000000000 +0200
@@ -13,7 +13,7 @@
#DESTDIR = /tmp/root
DEBUG =
DESTDIR =
-VERSION = 1.14
+VERSION = 1.15
DATE = $(shell date +'%d%b%y' | tr '[:lower:]' '[:upper:]')
COPTS =
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/showconsole-1.14/blogd.8 new/showconsole-1.15/blogd.8
--- old/showconsole-1.14/blogd.8 2011-03-22 11:11:03.000000000 +0100
+++ new/showconsole-1.15/blogd.8 2011-09-01 15:10:12.000000000 +0200
@@ -8,7 +8,6 @@
.\"
.TH BLOGD 8 "Nov 10, 2000" "Version 1.16" "The SuSE boot concept"
.UC 8
-.OS SuSE Linux
.SH NAME
blogd \- boot logging on /dev/console
.SH SYNOPSIS
@@ -65,7 +64,7 @@
that it should stop writing to disk but
continue to repeat messages to the old
devices of the system console.
-\."
+.\"
.SH BUGS
.B blogd
needs a mounted
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/showconsole-1.14/blogd.c new/showconsole-1.15/blogd.c
--- old/showconsole-1.14/blogd.c 2011-03-25 18:52:49.000000000 +0100
+++ new/showconsole-1.15/blogd.c 2011-04-20 11:21:40.000000000 +0200
@@ -41,6 +41,7 @@
# define _POSIX_MAX_CANON 255
#endif
extern volatile sig_atomic_t nsigsys;
+extern volatile sig_atomic_t signaled;
static const char console[] = "/dev/console";
@@ -66,7 +67,7 @@
_logger(fmt, ap);
va_end(ap);
popd();
- exit (1);
+ exit(EXIT_FAILURE);
}
/*
@@ -122,7 +123,6 @@
static struct sigaction saved_sigquit;
static struct sigaction saved_sigterm;
static struct sigaction saved_sigsys;
-static volatile sig_atomic_t signaled = 0;
static void sighandle(int sig)
{
@@ -318,6 +318,10 @@
cfmakeraw(&o);
cfsetispeed(&o, ispeed);
cfsetospeed(&o, ospeed);
+ o.c_lflag &= ~ECHO;
+ o.c_lflag |= ISIG;
+ o.c_cc[VTIME] = 0;
+ o.c_cc[VMIN] = CMIN;
if (openpty(&ptm, &pts, ptsname, &o, &w) < 0)
error("can not open pty/tty pair: %m\n");
@@ -336,7 +340,7 @@
dup2(0, 2);
secondtty(cons, st.st_rdev);
-exit(0);
+
(void)ioctl(0, TIOCCONS, NULL); /* Undo any current map if any */
close(0);
@@ -344,6 +348,20 @@
error("can not set console device to %s: %m\n", ptsname);
close(pts);
+ signaled = nsigsys = 0;
+ set_signal(SIGTTIN, &saved_sigttin, SIG_IGN);
+ set_signal(SIGTTOU, &saved_sigttou, SIG_IGN);
+ set_signal(SIGTSTP, &saved_sigtstp, SIG_IGN);
+ set_signal(SIGHUP, &saved_sighup, SIG_IGN);
+ set_signal(SIGINT, &saved_sigint, sighandle);
+ set_signal(SIGQUIT, &saved_sigquit, sighandle);
+ set_signal(SIGTERM, &saved_sigterm, sighandle);
+ set_signal(SIGSYS, &saved_sigsys, sigsys);
+ (void)siginterrupt(SIGINT, 0);
+ (void)siginterrupt(SIGQUIT, 0);
+ (void)siginterrupt(SIGTERM, 0);
+ (void)siginterrupt(SIGSYS, 0);
+
for (c = cons; c; c = c->next) {
int iflag, oflag;
#ifdef _PC_MAX_CANON
@@ -351,22 +369,34 @@
#endif
c->max_canon = _POSIX_MAX_CANON;
c->tlock = 0;
- if (tcgetattr(cons->fd, &cons->otio) < 0)
+ if (tcgetattr(c->fd, &c->otio) < 0)
continue;
c->tlock = 1;
-#if 1
+
iflag = c->otio.c_iflag;
oflag = c->otio.c_oflag;
- c->otio.c_iflag |= (ICRNL | IGNBRK);
- c->otio.c_iflag &= ~(INLCR | IGNCR | BRKINT);
- c->otio.c_oflag |= (ONLCR | OPOST);
- c->otio.c_oflag &= ~(OCRNL | ONLRET);
- (void)tcsetattr(cons->fd, TCSADRAIN, &cons->otio);
+ if (ioctl(c->fd, TIOCMGET, &flags) == 0) {
+ ispeed = cfgetispeed(&c->otio);
+ ospeed = cfgetospeed(&c->otio);
+
+ c->otio.c_iflag = c->otio.c_lflag = 0;
+ c->otio.c_oflag = (ONLCR | OPOST);
+ c->otio.c_cflag = CREAD | CS8 | HUPCL | (c->otio.c_cflag & CLOCAL);
+
+ cfsetispeed(&c->otio, ispeed);
+ cfsetospeed(&c->otio, ospeed);
+ } else {
+ c->otio.c_iflag |= (ICRNL | IGNBRK);
+ c->otio.c_iflag &= ~(INLCR | IGNCR | BRKINT);
+ c->otio.c_oflag |= (ONLCR | OPOST);
+ c->otio.c_oflag &= ~(OCRNL | ONLRET);
+ }
+ (void)tcsetattr(c->fd, TCSADRAIN, &c->otio);
c->otio.c_iflag = iflag;
c->otio.c_oflag = oflag;
-#endif
+
if ((c->otio.c_lflag & ICANON) == 0) {
c->otio.c_lflag |= ICANON | IEXTEN | ISIG | ECHO|ECHOE|ECHOK|ECHOKE;
c->otio.c_oflag |= OPOST;
@@ -384,20 +414,6 @@
}
}
- nsigsys = 0;
- set_signal(SIGTTIN, &saved_sigttin, SIG_IGN);
- set_signal(SIGTTOU, &saved_sigttou, SIG_IGN);
- set_signal(SIGTSTP, &saved_sigtstp, SIG_IGN);
- set_signal(SIGHUP, &saved_sighup, SIG_IGN);
- set_signal(SIGINT, &saved_sigint, sighandle);
- set_signal(SIGQUIT, &saved_sigquit, sighandle);
- set_signal(SIGTERM, &saved_sigterm, sighandle);
- set_signal(SIGSYS, &saved_sigsys, sigsys);
- (void)siginterrupt(SIGINT, 0);
- (void)siginterrupt(SIGQUIT, 0);
- (void)siginterrupt(SIGTERM, 0);
- (void)siginterrupt(SIGSYS, 0);
-
atexit(exit_handler); /* Register main exit handler */
switch ((pid = fork())) {
@@ -427,7 +443,7 @@
}
fprintf(stdout, "\rBoot logging started on %s(%s) at %.24s\n", tty, console, stt);
fflush(stdout);
- _exit(0); /* NEVER rise exit handlers here */
+ _exit(EXIT_SUCCESS); /* NEVER rise exit handlers here */
}
atexit(flush_handler); /* Register flush exit handler */
@@ -436,7 +452,7 @@
while (!signaled)
safeIO();
- exit(0); /* Raise exit handlers */
+ exit(EXIT_SUCCESS); /* Raise exit handlers */
}
static void flush_handler (void)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/showconsole-1.14/blogger.8 new/showconsole-1.15/blogger.8
--- old/showconsole-1.14/blogger.8 2001-01-29 20:17:12.000000000 +0100
+++ new/showconsole-1.15/blogger.8 2011-09-01 15:11:40.000000000 +0200
@@ -8,7 +8,6 @@
.\"
.TH BLOGGER 8 "Jan 26, 2001" "Version 1.16" "The SuSE boot concept"
.UC 8
-.OS SuSE Linux
.SH NAME
Blogger \- writes messages to a running blogd process
.SH SYNOPSIS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/showconsole-1.14/isserial.8 new/showconsole-1.15/isserial.8
--- old/showconsole-1.14/isserial.8 2010-08-24 11:17:06.000000000 +0200
+++ new/showconsole-1.15/isserial.8 2011-09-01 15:11:53.000000000 +0200
@@ -8,7 +8,6 @@
.\"
.TH SHOWCONSOLE 8 "Sep 05, 2003" "Version 1.16" "The SuSE boot concept"
.UC 8
-.OS SuSE Linux
.SH NAME
Isserial \- determines if the underlying tty of stdin is a serial line
.br
@@ -32,7 +31,7 @@
if
.B stdin
is a serial line otherwise not.
-\."
+.\"
.SH FILES
.TP
.I /dev/console
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/showconsole-1.14/libblogger.c new/showconsole-1.15/libblogger.c
--- old/showconsole-1.14/libblogger.c 2010-10-21 11:57:05.000000000 +0200
+++ new/showconsole-1.15/libblogger.c 2011-08-01 16:32:47.000000000 +0200
@@ -15,6 +15,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -40,9 +41,58 @@
#define ESNS "skipped" /* Skipped */
#define ESNU "unused" /* Unused */
+static struct sigaction saved_sigpipe;
+static volatile sig_atomic_t broken = 0;
static int fdfifo = -1;
static char * fifo_name = _PATH_BLOG_FIFO;
+static void sigpipe(int sig __attribute__((__unused__)))
+{
+ broken++;
+}
+
+static void set_signal(int sig, struct sigaction *old, sighandler_t handler)
+{
+ do {
+ if (sigaction(sig, NULL, old) == 0)
+ break;
+ } while (errno == EINTR);
+
+ if (old && old->sa_handler != handler) {
+ struct sigaction new;
+ sigset_t sigset;
+
+ new.sa_handler = handler;
+ sigemptyset(&new.sa_mask);
+ new.sa_flags = SA_RESTART;
+ do {
+ if (sigaction(sig, &new, NULL) == 0)
+ break;
+ } while (errno == EINTR);
+
+ sigemptyset(&sigset);
+ sigaddset(&sigset, sig);
+ sigprocmask(SIG_UNBLOCK, &sigset, NULL);
+ }
+}
+
+static void reset_signal(int sig, struct sigaction *old)
+{
+ struct sigaction cur;
+
+ do {
+ if (sigaction(sig, NULL, &cur) == 0)
+ break;
+ } while (errno == EINTR);
+
+ if (old && old->sa_handler == cur.sa_handler) {
+ do {
+ if (sigaction(sig, old, NULL) == 0)
+ break;
+ } while (errno == EINTR);
+ }
+}
+
static int bootlog_init(const int lvl __attribute__((__unused__)))
{
int ret = -1;
@@ -57,6 +107,8 @@
if ((fdfifo = open(fifo_name, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_CLOEXEC)) < 0)
goto out;
+ set_signal(SIGPIPE, &saved_sigpipe, sigpipe);
+
ret = 0;
out:
return ret;
@@ -66,6 +118,9 @@
{
if (fdfifo < 0)
goto out;
+
+ reset_signal(SIGPIPE, &saved_sigpipe);
+
(void)close(fdfifo);
out:
return;
@@ -77,6 +132,7 @@
int ret = -1;
char * head = ESNN;
char buf[4096];
+ sigset_t blockpipe, oldpipe;
if (fdfifo < 0 && bootlog_init(lvl) < 0)
goto out;
@@ -106,6 +162,9 @@
break;
}
+ sigprocmask(SIG_BLOCK, &blockpipe, &oldpipe);
+ if (broken)
+ goto pipe;
if (head) {
const struct tm *local;
struct timeval now;
@@ -124,6 +183,8 @@
vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
write(fdfifo, buf, strlen(buf));
+pipe:
+ sigprocmask(SIG_SETMASK, &oldpipe, NULL);
out:
return ret;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/showconsole-1.14/libconsole.c new/showconsole-1.15/libconsole.c
--- old/showconsole-1.14/libconsole.c 2011-03-25 18:50:59.000000000 +0100
+++ new/showconsole-1.15/libconsole.c 2011-08-01 16:00:51.000000000 +0200
@@ -59,6 +59,27 @@
#include "listing.h"
/*
+ * Used to ignore some signals during pselect(2)
+ */
+static sigset_t omask;
+
+/*
+ * Remember if we're signaled.
+ */
+volatile sig_atomic_t signaled;
+
+/*
+ * Error raised in exit handler should not call exit(3) its self
+ */
+#define lerror(fmt, args...) \
+ do { \
+ if (signaled) { \
+ warn(fmt, args); \
+ goto out; \
+ } error(fmt, args); \
+ } while (0)
+
+/*
* push and popd direcotry changes
*/
@@ -182,7 +203,9 @@
if (p < 0) {
if (errno == EPIPE) {
warn("error on writing to fd %d: %m\n", fd);
- exit (0);
+ if (signaled)
+ goto out;
+ exit(EXIT_SUCCESS);
}
if (errno == EINTR) {
errno = 0;
@@ -192,8 +215,9 @@
int ret;
fd_set check;
- if (repeated++ > 1000)
- error("repeated error on writing to fd %d: %m\n", fd);
+ if (repeated++ > 1000) {
+ lerror("repeated error on writing to fd %d: %m\n", fd);
+ }
FD_ZERO (&check);
FD_SET (fd, &check);
@@ -201,30 +225,33 @@
/* Avoid high load: wait upto two seconds if system is not ready */
errno = 0;
do {
- struct timeval two = {2, 0};
- ret = select(fd + 1, (fd_set*)0, &check, (fd_set*)0, &two);
+ struct timespec two = {2, 0};
+ ret = pselect(fd + 1, (fd_set*)0, &check, (fd_set*)0, &two, &omask);
} while ((ret < 0) && (errno == EINTR));
- if (ret < 0)
- error("can not write to fd %d: %m\n", fd);
+ if (ret < 0) {
+ lerror("can not write to fd %d: %m\n", fd);
+ }
errno = 0;
continue;
}
if (errno == EIO) {
- if ((eiocount++ > 10) || !vc_reconnect)
- error("can not write to fd %d: %m\n", fd);
+ if ((eiocount++ > 10) || !vc_reconnect) {
+ lerror("can not write to fd %d: %m\n", fd);
+ }
(*vc_reconnect)(fd);
errno = 0;
continue;
}
- error("can not write to fd %d: %m\n", fd);
+ lerror("can not write to fd %d: %m\n", fd);
}
repeated = 0;
ptr += p;
s -= p;
}
+out:
errno = saveerr;
}
@@ -244,14 +271,14 @@
t=0;
if ((ioctl(fd, FIONREAD, &t) < 0) || (t == 0)) {
fd_set check;
- struct timeval zero = {0, 0};
+ struct timespec zero = {0, 0};
do {
FD_ZERO (&check);
FD_SET (fd, &check);
/* Avoid deadlock: do not read if nothing is in there */
- if (select(fd + 1, &check, (fd_set*)0, (fd_set*)0, &zero) <= 0)
+ if (pselect(fd + 1, &check, (fd_set*)0, (fd_set*)0, &zero, &omask) <= 0)
break;
r = read (fd, ptr, s);
@@ -260,11 +287,11 @@
/* Do not exit on a broken FIFO */
if (r < 0 && errno != EPIPE) {
- if (noerr)
+ if (noerr || signaled)
goto out;
if (fd == 0 && errno == EIO)
warn("\e[31m\e[1msystem console stolen at line %d!\e[m\n", __LINE__);
- error("Can not read from fd %d: %m\n", fd);
+ lerror("Can not read from fd %d: %m\n", fd);
}
goto out;
@@ -277,17 +304,18 @@
while (t > 0) {
ssize_t p = read (fd, ptr, t);
if (p < 0) {
- if (repeated++ > 1000)
- error("Repeated error on reading from fd %d: %m\n", fd);
+ if (repeated++ > 1000) {
+ lerror("Repeated error on reading from fd %d: %m\n", fd);
+ }
if (errno == EINTR || errno == EAGAIN) {
errno = 0;
continue;
}
- if (noerr)
+ if (noerr || signaled)
goto out;
if (fd == 0 && errno == EIO)
warn("\e[31m\e[1msystem console stolen at line %d!\e[m\n", __LINE__);
- error("Can not read from fd %d: %m\n", fd);
+ lerror("Can not read from fd %d: %m\n", fd);
}
repeated = 0;
ptr += p;
@@ -302,7 +330,7 @@
/*
* The stdio file pointer for our log file
*/
-struct console *restrict cons;
+struct console *cons;
static FILE * flog = NULL;
static int fdread = -1;
static int fdfifo = -1;
@@ -310,7 +338,7 @@
/*
* Signal control for writing on log file
*/
-volatile sig_atomic_t nsigsys = 0;
+volatile sig_atomic_t nsigsys;
static volatile sig_atomic_t nsigio = -1;
static sigset_t save_oldset;
@@ -402,7 +430,7 @@
static inline void writelog(void)
{
if (!flog)
- goto xout;
+ return;
clearerr(flog);
lock(&llock);
while (avail > 0) {
@@ -411,8 +439,8 @@
if (avail > TRANS_BUFFER_SIZE)
ret = TRANS_BUFFER_SIZE;
- if (!flog)
- goto xout;;
+ if (!flog || nsigsys)
+ break;
ret = fwrite(head, sizeof(unsigned char), ret, flog);
if (!ret && ferror(flog))
break;
@@ -429,12 +457,10 @@
}
}
unlock(&llock);
- if (!flog)
- goto xout;;
- fflush(flog);
- fdatasync(fileno(flog));
-xout:
- return;
+ if (flog) {
+ fflush(flog);
+ fdatasync(fileno(flog));
+ }
}
static inline void flushlog(void)
@@ -771,6 +797,12 @@
pgroup = pgrp;
fdread = in;
+ (void)sigfillset(&omask);
+ (void)sigdelset(&omask, SIGQUIT);
+ (void)sigdelset(&omask, SIGTERM);
+ (void)sigdelset(&omask, SIGSYS);
+ (void)sigdelset(&omask, SIGIO);
+
if (fifo_name && fdfifo < 0) {
struct stat st;
errno = 0;
@@ -789,7 +821,7 @@
/*
* Seek for input, more input ...
*/
-static void more_input (struct timeval *timeout, const int noerr)
+static void more_input (struct timespec *timeout, const int noerr)
{
fd_set watch;
int nfds, wfds;
@@ -803,19 +835,16 @@
} else
wfds = fdread + 1;
- nfds = select(wfds, &watch, (fd_set*)0, (fd_set*)0, timeout);
+ nfds = pselect(wfds, &watch, (fd_set*)0, (fd_set*)0, timeout, &omask);
- if (nfds < 0) {
+ if (nfds <= 0) {
timeout->tv_sec = 0;
- timeout->tv_usec = 0;
- if (errno != EINTR)
- error ("select(): %m\n");
+ timeout->tv_nsec = 0;
+ if (nfds < 0 && errno != EINTR && !signaled)
+ error ("pselect(): %m\n");
goto nothing;
}
- if (!nfds)
- goto nothing;
-
if (FD_ISSET(fdread, &watch)) {
const ssize_t cnt = safein(fdread, (char*)trans, sizeof(trans), noerr);
static struct winsize owz;
@@ -863,7 +892,7 @@
*/
void safeIO (void)
{
- struct timeval timeout;
+ struct timespec timeout;
static int log = -1;
if (!nsigio) /* signal handler set but no signal recieved */
@@ -898,8 +927,12 @@
(*vr_access)();
vr_access = NULL;
}
- if ((flog = fdopen (log, "a")) == NULL)
- error("Can not open %s: %m\n", BOOT_LOGFILE);
+ lock(&llock);
+ if ((flog = fdopen (log, "a")) == NULL) {
+ unlock(&llock);
+ error("Can not open %s: %m\n", BOOT_LOGFILE);
+ }
+ unlock(&llock);
nsigio = SIGIO; /* We do not need a signal handler */
(void)signal(SIGIO, SIG_IGN);
@@ -927,7 +960,7 @@
}
timeout.tv_sec = 5;
- timeout.tv_usec = 0;
+ timeout.tv_nsec = 0;
more_input(&timeout, 0);
if (flog && !running) {
@@ -958,7 +991,7 @@
*/
void closeIO(void)
{
- struct timeval timeout;
+ struct timespec timeout;
struct console * c;
int n = 240;
@@ -983,12 +1016,12 @@
n--;
timeout.tv_sec = 0;
- timeout.tv_usec = 25*1000;
+ timeout.tv_nsec = 25*1000*1000;
more_input(&timeout, 1);
(void)tcdrain(fdread);
- } while (timeout.tv_sec || timeout.tv_usec);
+ } while (timeout.tv_sec || timeout.tv_nsec);
if (running) {
lock(&ljoin);
@@ -998,20 +1031,16 @@
pthread_cancel(lthread);
}
- if (!flog)
- goto xout;
-
- writelog();
-
- if (!nl)
- fputc('\n', flog);
-
- if (!flog)
- goto xout;
-
- (void)fclose(flog);
+ if (flog) {
+ writelog();
+ if (!nl)
+ fputc('\n', flog);
+ (void)fclose(flog);
+ }
+ lock(&llock);
flog = NULL;
-xout:
+ unlock(&llock);
+
if (fdfifo >= 0) {
close(fdfifo);
fdfifo = -1;
@@ -1101,7 +1130,7 @@
printf("|%u|%u|", tty, ttypgrp); /* stdout to pipe synchronize ... */
- exit(0);
+ exit(EXIT_SUCCESS);
} break;
case -1:
error("can not execute: %m\n");
@@ -1463,6 +1492,10 @@
return;
}
tail->next = newc;
+ tail->tlock = 0;
+ tail->max_canon = _POSIX_MAX_CANON;
+ memset(&tail->ltio, 0, sizeof(tail->ltio));
+ memset(&tail->otio, 0, sizeof(tail->otio));
tail = tail->next;
if ((flags = fcntl(newc->fd, F_GETFL)) < 0)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/showconsole-1.14/libconsole.h new/showconsole-1.15/libconsole.h
--- old/showconsole-1.14/libconsole.h 2011-03-25 09:37:16.000000000 +0100
+++ new/showconsole-1.15/libconsole.h 2011-03-31 16:47:22.000000000 +0200
@@ -39,7 +39,7 @@
int fd, tlock;
ssize_t max_canon;
struct termios ltio, otio;
- struct console *restrict next;
+ struct console * next;
};
extern void error (const char *fmt, ...) attribute((__noreturn__, __format__(__printf__, 1, 2)));
extern void warn (const char *fmt, ...) attribute((__format__(__printf__, 1, 2)));
@@ -50,6 +50,6 @@
extern void prepareIO(void (*rfunc)(int), void (*pfunc)(void), const pid_t, const int);
extern void safeIO (void);
extern void closeIO(void);
-extern struct console *restrict cons;
+extern struct console *cons;
#define alignof(type) ((sizeof(type)+(sizeof(void*)-1)) & ~(sizeof(void*)-1))
#define strsize(string) ((strlen(string)+1)*sizeof(char))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/showconsole-1.14/showconsole-1.14.lsm new/showconsole-1.15/showconsole-1.14.lsm
--- old/showconsole-1.14/showconsole-1.14.lsm 2011-03-25 18:55:24.000000000 +0100
+++ new/showconsole-1.15/showconsole-1.14.lsm 1970-01-01 01:00:00.000000000 +0100
@@ -1,15 +0,0 @@
-Begin3
-Title: console tools for boot scripts
-Version: 1.14
-Entered-date: 25MAR11
-Description: Used for fetch the real device in boot scripts
- running on /dev/console.
-Keywords: boot control
-Author: Werner Fink
-Maintained-by: Werner Fink
-Primary-site: sunsite.unc.edu /pub/Linux/system/daemons/init
- @UNKNOWN showconsole-1.14.tar.gz
-Alternate-site: ftp.suse.com /pub/projects/init
-Platforms: Linux with System VR2 or higher boot scheme
-Copying-policy: GPL
-End
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/showconsole-1.14/showconsole-1.15.lsm new/showconsole-1.15/showconsole-1.15.lsm
--- old/showconsole-1.14/showconsole-1.15.lsm 1970-01-01 01:00:00.000000000 +0100
+++ new/showconsole-1.15/showconsole-1.15.lsm 2011-09-01 15:13:48.000000000 +0200
@@ -0,0 +1,15 @@
+Begin3
+Title: console tools for boot scripts
+Version: 1.15
+Entered-date: 01SEP11
+Description: Used for fetch the real device in boot scripts
+ running on /dev/console.
+Keywords: boot control
+Author: Werner Fink
+Maintained-by: Werner Fink
+Primary-site: sunsite.unc.edu /pub/Linux/system/daemons/init
+ @UNKNOWN showconsole-1.15.tar.gz
+Alternate-site: ftp.suse.com /pub/projects/init
+Platforms: Linux with System VR2 or higher boot scheme
+Copying-policy: GPL
+End
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/showconsole-1.14/showconsole.8 new/showconsole-1.15/showconsole.8
--- old/showconsole-1.14/showconsole.8 2010-11-09 17:00:14.000000000 +0100
+++ new/showconsole-1.15/showconsole.8 2011-04-01 15:18:14.000000000 +0200
@@ -41,7 +41,7 @@
the
.B setconsole
undo any redirection.
-\."
+.\"
.SH OPTIONS
.TP
.B \-n
@@ -50,7 +50,7 @@
kernel for the major and minor device numbers of a not
existing device file in
.IR /dev .
-\."
+.\"
.SH BUGS
.B showconsole
needs a mounted
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org