OBS User unknown 2008-11-20 15:27:15 +00:00 committed by Git OBS Bridge
parent 86198d1ced
commit 13600661e1
4 changed files with 125 additions and 20 deletions

View File

@ -16,6 +16,10 @@
if test -z "$REDIRECT" ; then
REDIRECT=$(showconsole 2>/dev/null)
if test -n "$REDIRECT" ; then
if test "$devpts" != "yes" ; then
mount -t devpts devpts /dev/pts
devpts=yes
fi
> /dev/shm/initrd.msg
ln -sf /dev/shm/initrd.msg /var/log/boot.msg
mkdir -p /var/run

View File

@ -1,5 +1,5 @@
--- blogd.c
+++ blogd.c 2008-06-13 13:30:56.867756846 +0200
+++ blogd.c 2008-06-13 13:30:56.867756000 +0200
@@ -220,10 +220,12 @@ int main(int argc, char *argv[])
{
int fd, fd2, flags;
@ -51,8 +51,48 @@
close(0);
rmfpid();
--- libconsole.c
+++ libconsole.c 2008-06-13 13:38:25.436903735 +0200
@@ -724,10 +724,12 @@ static void *action(void *dummy)
+++ libconsole.c 2008-11-19 14:02:28.354541446 +0100
@@ -215,7 +215,7 @@ static inline void safeout (int fd, cons
/*
* Twice used: safe in
*/
-static inline ssize_t safein (int fd, char *ptr, size_t s)
+static inline ssize_t safein (int fd, char *ptr, size_t s, const int noerr)
{
int saveerr = errno;
ssize_t r = 0;
@@ -223,7 +223,7 @@ static inline ssize_t safein (int fd, c
static int repeated;
if (s > SSIZE_MAX)
- error("Can not read from fd %d: %m", fd, strerror(EINVAL));
+ s = SSIZE_MAX;
if ((ioctl(fd, FIONREAD, &t) < 0) || (t == 0)) {
fd_set check;
@@ -242,8 +242,11 @@ static inline ssize_t safein (int fd, c
} while (r < 0 && (errno == EINTR || errno == EAGAIN));
/* Do not exit on a broken FIFO */
- if (r < 0 && errno != EPIPE)
+ if (r < 0 && errno != EPIPE) {
+ if (noerr)
+ goto out;
error("Can not read from fd %d: %s\n", fd, STRERR);
+ }
goto out;
}
@@ -261,6 +264,8 @@ static inline ssize_t safein (int fd, c
errno = 0;
continue;
}
+ if (noerr)
+ goto out;
error("Can not read from fd %d: %s\n", fd, STRERR);
}
repeated = 0;
@@ -724,10 +729,12 @@ static void *action(void *dummy)
* Prepare I/O
*/
static const char *fifo_name = _PATH_BLOG_FIFO;
@ -66,10 +106,21 @@
fdread = in;
fdwrite = out;
fdsec = second;
@@ -778,9 +780,19 @@ static void more_input (struct timeval *
@@ -749,7 +756,7 @@ void prepareIO(void (*rfunc)(int), const
/*
* Seek for input, more input ...
*/
-static void more_input (struct timeval *timeout)
+static void more_input (struct timeval *timeout, const int noerr)
{
fd_set watch;
int nfds, wfds;
@@ -777,10 +784,20 @@ static void more_input (struct timeval *
goto nothing;
if (FD_ISSET(fdread, &watch)) {
const ssize_t cnt = safein(fdread, (char*)trans, sizeof(trans));
- const ssize_t cnt = safein(fdread, (char*)trans, sizeof(trans));
+ const ssize_t cnt = safein(fdread, (char*)trans, sizeof(trans), noerr);
+ static struct winsize owz;
+ struct winsize wz;
@ -87,8 +138,44 @@
safeout(fdwrite, (char*)trans, cnt); /* Write copy of input to real tty */
(void)tcdrain(fdwrite);
@@ -795,7 +812,7 @@ static void more_input (struct timeval *
}
if (fdfifo > 0 && FD_ISSET(fdfifo, &watch)) {
- const ssize_t cnt = safein(fdfifo, (char*)trans, sizeof(trans));
+ const ssize_t cnt = safein(fdfifo, (char*)trans, sizeof(trans), noerr);
if (cnt > 0) {
copylog(trans, cnt); /* Make copy of the input */
@@ -873,7 +890,7 @@ skip:
timeout.tv_sec = 5;
timeout.tv_usec = 0;
- more_input(&timeout);
+ more_input(&timeout, 0);
if (flog && !running) {
int policy = SCHED_RR;
@@ -920,7 +937,7 @@ void closeIO(void)
timeout.tv_sec = 0;
timeout.tv_usec = 5*100*1000; /* A half second */
- more_input(&timeout);
+ more_input(&timeout, 1);
if (!flog)
break;
@@ -968,7 +985,7 @@ static void ctty(pid_t pid, unsigned int
sprintf(fetched, "/proc/%d/stat", (int)pid);
if ((fd = open(fetched, O_RDONLY|O_NOCTTY)) < 0)
error("can not open(%s): %s\n", fetched, STRERR);
- cnt = safein(fd, fetched, sizeof(fetched));
+ cnt = safein(fd, fetched, sizeof(fetched), 0);
close(fd);
if (cnt <= 0)
--- libconsole.h
+++ libconsole.h 2008-06-13 13:31:59.302034490 +0200
+++ libconsole.h 2008-06-13 13:31:59.302034000 +0200
@@ -2,6 +2,6 @@ extern void pushd(const char * path);
extern void popd(void);
extern char * fetchtty(const pid_t pid, const pid_t ppid, unsigned int *mjmi);

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Wed Nov 19 14:07:33 CET 2008 - werner@suse.de
- Avoid error messages if blogd is closed premature
-------------------------------------------------------------------
Tue Nov 18 18:44:25 CET 2008 - werner@suse.de
- Mount devpts in initrd (bnc#442891)
-------------------------------------------------------------------
Wed Oct 1 18:08:36 CEST 2008 - werner@suse.de

View File

@ -30,7 +30,7 @@ Group: System/Base
PreReq: coreutils
AutoReqProv: on
Version: 2.86
Release: 185
Release: 186
Summary: SysV-Style init
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: libselinux-devel libsepol-devel
@ -317,6 +317,10 @@ rm -rf ${RPM_BUILD_ROOT}
%doc %{_mandir}/man8/startpar.8.gz
%changelog
* Wed Nov 19 2008 werner@suse.de
- Avoid error messages if blogd is closed premature
* Tue Nov 18 2008 werner@suse.de
- Mount devpts in initrd (bnc#442891)
* Wed Oct 01 2008 werner@suse.de
- Minimize fuse patch
* Wed Oct 01 2008 ro@suse.de
@ -446,7 +450,7 @@ rm -rf ${RPM_BUILD_ROOT}
* Tue Nov 08 2005 werner@suse.de
- Move version of killproc to 2.11
* Allow to set a prefix and to disable usleep
* Thu Nov 03 2005 dmueller@suse.de
* Wed Nov 02 2005 dmueller@suse.de
- don't build as root
* Wed Nov 02 2005 werner@suse.de
- Move version of killporc to 2.10
@ -475,7 +479,7 @@ rm -rf ${RPM_BUILD_ROOT}
the specified pid file does not exist that the daemon is not
running (bug #105845).
- Add the possibility of using pid numbers instead of a pid file.
* Wed Jun 29 2005 schwab@suse.de
* Tue Jun 28 2005 schwab@suse.de
- Fix typo.
* Wed May 25 2005 werner@suse.de
- Bounce showconsole to version 1.08
@ -818,7 +822,7 @@ rm -rf ${RPM_BUILD_ROOT}
all file holders including the mmaping processes.
* Wed Jun 28 2000 bk@suse.de
- enabled reboot on s390
* Mon Jun 26 2000 bk@suse.de
* Sun Jun 25 2000 bk@suse.de
- removed some not needed files on s390
* Tue May 30 2000 werner@suse.de
- Correct path of powerstatus (/var/run/powerstatus) of powerd
@ -829,7 +833,7 @@ rm -rf ${RPM_BUILD_ROOT}
* Wed May 17 2000 garloff@suse.de
- Added software-suspend support to init.
- login option of mingetty limits logname to 42 chars.
* Thu May 11 2000 garloff@suse.de
* Wed May 10 2000 garloff@suse.de
- Working patch for mingetty to support devfs.
* Wed May 10 2000 garloff@suse.de
- Preliminary patch for devfs.
@ -837,7 +841,7 @@ rm -rf ${RPM_BUILD_ROOT}
- Make it more secure by passing the logname as one arg and by
checking for a leading '-'. The manpage tells the sysadmin
about possible risks now.
* Wed May 10 2000 garloff@suse.de
* Tue May 09 2000 garloff@suse.de
- Added new options --login and --logopts to mingetty, so you may
create an inittab entry using ssh for login or similar
* Tue Mar 07 2000 werner@suse.de
@ -850,7 +854,7 @@ rm -rf ${RPM_BUILD_ROOT}
- Set the terminal line immediately
* Mon Mar 06 2000 werner@suse.de
- Avoid script handling for kernel threads
* Mon Mar 06 2000 werner@suse.de
* Sun Mar 05 2000 werner@suse.de
- If open fails -1 is returned (close bug #2200)
* Fri Mar 03 2000 kukuk@suse.de
- Create /usr/bin/shutdown link for UltraSPARC kernel
@ -866,13 +870,13 @@ rm -rf ${RPM_BUILD_ROOT}
- Avoid trouble with hard links of binaries
* Sun Nov 07 1999 kukuk@suse.de
- mingetty: Add 1900 to tm_year, it contains the years since 1900.
* Thu Nov 04 1999 werner@suse.de
* Wed Nov 03 1999 werner@suse.de
- New killproc 1.12
* Fix option -q of startproc
* Fix Bug in wait4 handling of startproc
* Fix script detection: do not handle startproc, killproc, and
checkproc as script interpreters
* Tue Nov 02 1999 werner@suse.de
* Mon Nov 01 1999 werner@suse.de
- Add a patch from Marius
* Fri Oct 29 1999 werner@suse.de
- powerd should tell init if status is OK again
@ -884,9 +888,9 @@ rm -rf ${RPM_BUILD_ROOT}
- Use RPM_OPT_FLAGS throughout
* Mon Sep 13 1999 bs@suse.de
- ran old prepare_spec on spec file to switch to new prepare_spec.
* Wed Sep 08 1999 werner@suse.de
* Tue Sep 07 1999 werner@suse.de
- Enable mingetty resetting the terminal
* Sat Aug 07 1999 werner@suse.de
* Fri Aug 06 1999 werner@suse.de
- New killproc-1.10
* startproc which is able to sleep
* better zombie handling
@ -904,7 +908,7 @@ rm -rf ${RPM_BUILD_ROOT}
- Update to sysvinit 2.76
* Integrate newest sysvinit patch of jurix into
our patch. The command last is part of sysvinit.
* Wed Jun 23 1999 werner@suse.de
* Tue Jun 22 1999 werner@suse.de
- Update to new killproc version 1.8
* startproc knows about setsid to set up a new process session
for the new task (option -s)
@ -941,11 +945,11 @@ rm -rf ${RPM_BUILD_ROOT}
- Integrate powerd-2.0 for a replacment of the obsolate old one
* Mon Nov 02 1998 ro@suse.de
- update to killproc-1.6
* Thu Oct 22 1998 ro@suse.de
* Wed Oct 21 1998 ro@suse.de
- update to killproc-1.5 (take 2)
* Thu Oct 08 1998 ro@suse.de
- killproc: libinit.c output of "can't open pid file" only "#if DEBUG"
* Wed Oct 07 1998 ro@suse.de
* Tue Oct 06 1998 ro@suse.de
- updated killproc to get rid of a memleak
* Mon Oct 05 1998 ro@suse.de
- new version: killproc-1.4