skalibs

Mirror/fork of https://skarnet.org/software/skalibs/
git clone https://ccx.te2000.cz/git/skalibs
Log | Files | Refs | README | LICENSE

strerr_warnvsys.c (427B)


      1 /* ISC license. */
      2 
      3 /* MT-unsafe */
      4 
      5 #include <string.h>
      6 #include <errno.h>
      7 
      8 #include <skalibs/buffer.h>
      9 #include <skalibs/strerr.h>
     10 
     11 void strerr_warnvsys (char const *const *v, unsigned int n)
     12 {
     13   int e = errno ;
     14   for (unsigned int i = 0 ; i < n ; i++)
     15     if (v[i]) buffer_puts(buffer_2, v[i]) ;
     16   buffer_put(buffer_2, ": ", 2) ;
     17   buffer_puts(buffer_2, strerror(e)) ;
     18   buffer_putflush(buffer_2, "\n", 1) ;
     19   errno = e ;
     20 }