OBS User unknown 2009-05-04 16:35:27 +00:00 committed by Git OBS Bridge
parent 678f4bb7ef
commit 06cd2b96bb
3 changed files with 65 additions and 15 deletions

View File

@ -1,5 +1,20 @@
--- Makefile
+++ Makefile 2009-05-04 12:21:20.643778409 +0200
@@ -71,10 +71,10 @@ libblogger.a: libblogger.o
$(AR) $@ $^
showconsole: showconsole.c libconsole.o
- $(CC) $(CFLAGS) $(CLOOP) -o $@ $^ -pthread
+ $(CC) $(CFLAGS) $(CLOOP) -o $@ $^ -Wl,--as-needed -pthread
blogd: blogd.c libconsole.o
- $(CC) $(CFLAGS) $(CLOOP) -o $@ $^ -lutil -pthread
+ $(CC) $(CFLAGS) $(CLOOP) -o $@ $^ -Wl,--as-needed -lutil -pthread
blogger: blogger.c libblogger.a
$(CC) $(CFLAGS) $(CLOOP) -o $@ $^
--- blogd.c
+++ blogd.c 2008-06-13 13:30:56.867756000 +0200
+++ blogd.c 2009-05-04 12:04:11.566915578 +0200
@@ -220,10 +220,12 @@ int main(int argc, char *argv[])
{
int fd, fd2, flags;
@ -51,8 +66,16 @@
close(0);
rmfpid();
--- libconsole.c
+++ libconsole.c 2008-11-19 14:02:28.354541446 +0100
@@ -215,7 +215,7 @@ static inline void safeout (int fd, cons
+++ libconsole.c 2009-05-04 12:06:34.477901880 +0200
@@ -15,6 +15,7 @@
#include <sys/types.h> /* Defines the macros major and minor */
#include <sys/stat.h>
#include <sys/ioctl.h>
+#include <sys/mman.h>
#include <sys/socket.h>
#include <sys/param.h>
#include <sys/un.h>
@@ -215,7 +216,7 @@ static inline void safeout (int fd, cons
/*
* Twice used: safe in
*/
@ -61,7 +84,7 @@
{
int saveerr = errno;
ssize_t r = 0;
@@ -223,7 +223,7 @@ static inline ssize_t safein (int fd, c
@@ -223,7 +224,7 @@ static inline ssize_t safein (int fd, c
static int repeated;
if (s > SSIZE_MAX)
@ -70,7 +93,7 @@
if ((ioctl(fd, FIONREAD, &t) < 0) || (t == 0)) {
fd_set check;
@@ -242,8 +242,11 @@ static inline ssize_t safein (int fd, c
@@ -242,8 +243,11 @@ static inline ssize_t safein (int fd, c
} while (r < 0 && (errno == EINTR || errno == EAGAIN));
/* Do not exit on a broken FIFO */
@ -83,7 +106,7 @@
goto out;
}
@@ -261,6 +264,8 @@ static inline ssize_t safein (int fd, c
@@ -261,6 +265,8 @@ static inline ssize_t safein (int fd, c
errno = 0;
continue;
}
@ -92,7 +115,7 @@
error("Can not read from fd %d: %s\n", fd, STRERR);
}
repeated = 0;
@@ -724,10 +729,12 @@ static void *action(void *dummy)
@@ -724,10 +730,12 @@ static void *action(void *dummy)
* Prepare I/O
*/
static const char *fifo_name = _PATH_BLOG_FIFO;
@ -106,7 +129,13 @@
fdread = in;
fdwrite = out;
fdsec = second;
@@ -749,7 +756,7 @@ void prepareIO(void (*rfunc)(int), const
@@ -744,12 +752,13 @@ void prepareIO(void (*rfunc)(int), const
warn("can not open named fifo %s: %s\n", fifo_name, STRERR);
}
}
+ (void)mlockall(MCL_FUTURE);
}
/*
* Seek for input, more input ...
*/
@ -115,7 +144,7 @@
{
fd_set watch;
int nfds, wfds;
@@ -777,10 +784,20 @@ static void more_input (struct timeval *
@@ -777,10 +786,20 @@ static void more_input (struct timeval *
goto nothing;
if (FD_ISSET(fdread, &watch)) {
@ -138,7 +167,7 @@
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 *
@@ -795,7 +814,7 @@ static void more_input (struct timeval *
}
if (fdfifo > 0 && FD_ISSET(fdfifo, &watch)) {
@ -147,7 +176,7 @@
if (cnt > 0) {
copylog(trans, cnt); /* Make copy of the input */
@@ -873,7 +890,7 @@ skip:
@@ -873,7 +892,7 @@ skip:
timeout.tv_sec = 5;
timeout.tv_usec = 0;
@ -156,16 +185,28 @@
if (flog && !running) {
int policy = SCHED_RR;
@@ -920,7 +937,7 @@ void closeIO(void)
@@ -895,7 +914,7 @@ skip:
void closeIO(void)
{
struct timeval timeout;
- int n = 6;
+ int n = 240;
/* Maybe we've catched a signal, therefore */
if (flog) {
@@ -918,9 +937,9 @@ void closeIO(void)
n--;
timeout.tv_sec = 0;
timeout.tv_usec = 5*100*1000; /* A half second */
- timeout.tv_usec = 5*100*1000; /* A half second */
+ timeout.tv_usec = 25*1000;
- more_input(&timeout);
+ more_input(&timeout, 1);
if (!flog)
break;
@@ -968,7 +985,7 @@ static void ctty(pid_t pid, unsigned int
@@ -968,7 +987,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);

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon May 4 12:22:55 CEST 2009 - werner@suse.de
- Blogd: shorten minimal timeout at the end and hold all pages
in physical RAM
-------------------------------------------------------------------
Thu Apr 30 11:42:34 CEST 2009 - werner@suse.de

View File

@ -30,7 +30,7 @@ Group: System/Base
PreReq: coreutils
AutoReqProv: on
Version: 2.86
Release: 206
Release: 207
Summary: SysV-Style init
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: libselinux-devel libsepol-devel
@ -327,6 +327,9 @@ rm -rf ${RPM_BUILD_ROOT}
%doc %{_mandir}/man8/mkill.8.gz
%changelog
* Mon May 04 2009 werner@suse.de
- Blogd: shorten minimal timeout at the end and hold all pages
in physical RAM
* Thu Apr 30 2009 werner@suse.de
- For usleep(8) use nanosleep(2) instead of obsolete usleep(3)
* Wed Apr 29 2009 werner@suse.de