12
|
1 |
/*
|
|
2 |
stdin mix - a mixer/multiplexer for stdin to processes
|
|
3 |
Copyright (C) 2007 LluĂs Batlle i Rossell
|
|
4 |
|
|
5 |
Please find the license in the provided COPYING file.
|
|
6 |
*/
|
0
|
7 |
#include <stdio.h>
|
|
8 |
#include <stdlib.h>
|
14
|
9 |
#include <stdarg.h>
|
|
10 |
#include <string.h>
|
|
11 |
#include <errno.h>
|
0
|
12 |
|
3
|
13 |
#include "main.h"
|
0
|
14 |
|
14
|
15 |
void error(const char *msg, ...)
|
0
|
16 |
{
|
14
|
17 |
va_list v;
|
|
18 |
|
|
19 |
va_start(v, msg);
|
|
20 |
vfprintf(stderr, msg, v);
|
|
21 |
putc('\n', stderr);
|
|
22 |
fprintf(stderr, " errno %i: %s\n", errno, strerror(errno));
|
0
|
23 |
exit(-1);
|
|
24 |
}
|
|
25 |
|