runit

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

strerr_die.c (876B)


      1 /* Public domain. */
      2 
      3 #include <unistd.h>
      4 #include "buffer.h"
      5 #include "strerr.h"
      6 
      7 void strerr_warn(const char *x1,const char *x2,const char *x3,const char *x4,const char *x5,const char *x6,const struct strerr *se)
      8 {
      9   strerr_sysinit();
     10  
     11   if (x1) buffer_puts(buffer_2,x1);
     12   if (x2) buffer_puts(buffer_2,x2);
     13   if (x3) buffer_puts(buffer_2,x3);
     14   if (x4) buffer_puts(buffer_2,x4);
     15   if (x5) buffer_puts(buffer_2,x5);
     16   if (x6) buffer_puts(buffer_2,x6);
     17  
     18   while(se) {
     19     if (se->x) buffer_puts(buffer_2,se->x);
     20     if (se->y) buffer_puts(buffer_2,se->y);
     21     if (se->z) buffer_puts(buffer_2,se->z);
     22     se = se->who;
     23   }
     24  
     25   buffer_puts(buffer_2,"\n");
     26   buffer_flush(buffer_2);
     27 }
     28 
     29 void strerr_die(int e,const char *x1,const char *x2,const char *x3,const char *x4,const char *x5,const char *x6,const struct strerr *se)
     30 {
     31   strerr_warn(x1,x2,x3,x4,x5,x6,se);
     32   _exit(e);
     33 }