sm

sysmgr implemented in C
git clone git://git.ckyln.com/sm
Log | Files | Refs | README | LICENSE

io.c (341B)


      1 #include <stdio.h>
      2 #include <stdlib.h>
      3 #include <stdarg.h>
      4 #include <string.h>
      5 
      6 #include "../util.h"
      7 
      8 void
      9 die(const char *msg, ...)
     10 {
     11 	va_list ap;
     12 
     13 	va_start(ap, msg);
     14 	vfprintf(stderr, msg, ap);
     15 	va_end(ap);
     16 
     17 	if (msg[0] && msg[strlen(msg)-1] == ':') {
     18 		fputc(' ', stderr);
     19 		perror(NULL);
     20 	} else {
     21 		fputc('\n', stderr);
     22 	}
     23 	exit(1);
     24 }