Petr Lautrbach | 12 Oct 2010 15:36
Picon
Favicon
Gravatar

[sysvinit-devel] [PATCH] fix counting message lines in wall.c

Hello,

the wall(1) man page says that message is limited to 20 lines but in reality it's 22 for now.

This patch fixes that.

Regards,

Petr
--

-- 
Petr Lautrbach, Red Hat, Inc.
Index: sysvinit/trunk/src/wall.c
===================================================================
--- sysvinit/trunk/src/wall.c	(revision 95)
+++ sysvinit/trunk/src/wall.c	(working copy)
 <at>  <at>  -102,7 +102,7  <at>  <at> 

   i = 0;
   for (p = buf; *p; p++) {
-	if (*p == '\n' && i++ > MAXLINES) {
+	if (*p == '\n' && ++i >= MAXLINES) {
 		*++p = 0;
 		break;
 	}
洪绪 郭 | 17 Oct 2010 08:49
Picon
Favicon

[sysvinit-devel] init: add longer select interval for check_init_fifo() function

Currently, init process polls pipe_fd every 5s. This hurts power on battery driven devices. Becasue this timer interrupt prevent the system from sleeping for longer time. This patch adds the polling interval to 60s. This patch does not cause any harm to check_init_fifo() , becasue init process can make response immediately when there is message in the pipe.
 

Signed-off-by: Xia Wu miracle_difei <at> yahoo.com.cn

---
 init.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/init.c b/init.c
index 7d3827c..0583218 100644
--- a/init.c
+++ b/init.c
<at> <at> -2225,7 +2225,7 <at> <at> void check_init_fifo(void)
  /* Do select, return on EINTR. */
  FD_ZERO(&fds);
  FD_SET(pipe_fd, &fds);
- tv.tv_sec = 5;
+ tv.tv_sec = 60;
  tv.tv_usec = 0;
  n = select(pipe_fd + 1, &fds, NULL, NULL, &tv);
  if (n <= 0) {
--
1.7.2.3

 

Gmane