Hello community,

here is the log from the commit of package sysvinit for openSUSE:Factory
checked in at Tue Aug 2 08:55:35 CEST 2011.



--------
--- sysvinit/sysvinit.changes   2011-07-27 15:22:47.000000000 +0200
+++ /mounts/work_src_done/STABLE/sysvinit/sysvinit.changes      2011-08-01 
16:48:32.000000000 +0200
@@ -1,0 +2,7 @@
+Mon Aug  1 14:25:56 UTC 2011 - wer...@suse.de
+
+- libblogger: check for SIGPIPE and block SIGPIPE during write, this
+  also does help startpar not to die on SIGPIPE (bnc#679671)
+- blogd: add a further check for nsigsys in writelog() (bnc#679671)
+
+-------------------------------------------------------------------

calling whatdependson for head-i586


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ sysvinit.spec ++++++
--- /var/tmp/diff_new_pack.ltEFC2/_old  2011-08-02 08:50:17.000000000 +0200
+++ /var/tmp/diff_new_pack.ltEFC2/_new  2011-08-02 08:50:17.000000000 +0200
@@ -29,7 +29,7 @@
 Group:          System/Base
 AutoReqProv:    on
 Version:        2.88+
-Release:        56
+Release:        58
 Summary:        SysV-Style init
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildRequires:  audit-devel libselinux-devel libsepol-devel pam-devel

++++++ showconsole-1.14.dif ++++++
--- /var/tmp/diff_new_pack.ltEFC2/_old  2011-08-02 08:50:17.000000000 +0200
+++ /var/tmp/diff_new_pack.ltEFC2/_new  2011-08-02 08:50:17.000000000 +0200
@@ -170,8 +170,123 @@
  .SH FILES
  .TP
  .I /dev/console
+--- libblogger.c
++++ libblogger.c       2011-08-01 14:32:47.599926864 +0000
+@@ -15,6 +15,7 @@
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <paths.h>
++#include <signal.h>
+ #include <stdarg.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -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 @@ static int bootlog_init(const int lvl __
+     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 @@ void closeblog()
+ {
+     if (fdfifo < 0)
+       goto out;
++
++    reset_signal(SIGPIPE,  &saved_sigpipe);
++
+     (void)close(fdfifo);
+ out:
+     return;
+@@ -77,6 +132,7 @@ int bootlog(const int lvl, const char *f
+     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 @@ int bootlog(const int lvl, const char *f
+           break;
+     }
+ 
++    sigprocmask(SIG_BLOCK, &blockpipe, &oldpipe);
++    if (broken)
++      goto pipe;
+     if (head) {
+       const struct tm *local;
+       struct timeval now;
+@@ -124,6 +183,8 @@ int bootlog(const int lvl, const char *f
+     vsnprintf(buf, sizeof(buf), fmt, ap);
+     va_end(ap);
+     write(fdfifo, buf, strlen(buf));
++pipe:
++    sigprocmask(SIG_SETMASK, &oldpipe, NULL);
+ out:
+     return ret;
+ }
 --- libconsole.c
-+++ libconsole.c       2011-04-20 11:13:46.815926166 +0000
++++ libconsole.c       2011-08-01 14:00:51.311926463 +0000
 @@ -59,6 +59,27 @@
  #include "listing.h"
  
@@ -345,11 +460,13 @@
      clearerr(flog);
      lock(&llock);
      while (avail > 0) {
-@@ -412,7 +440,7 @@ static inline void writelog(void)
+@@ -411,8 +439,8 @@ static inline void writelog(void)
+       if (avail > TRANS_BUFFER_SIZE)
            ret = TRANS_BUFFER_SIZE;
  
-       if (!flog)
+-      if (!flog)
 -          goto xout;;
++      if (!flog || nsigsys)
 +          break;
        ret = fwrite(head, sizeof(unsigned char), ret, flog);
        if (!ret && ferror(flog))


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to