Import Debian changes 20180207-1
[hcoop/debian/mlton.git] / runtime / util / die.c
1 /* Copyright (C) 2004-2006 Henry Cejtin, Matthew Fluet, Suresh
2 * Jagannathan, and Stephen Weeks.
3 *
4 * MLton is released under a BSD-style license.
5 * See the file MLton-LICENSE for details.
6 */
7
8 #include "util.h"
9
10 void die (const char *fmt, ...) {
11 va_list args;
12
13 fflush(stdout);
14 va_start(args, fmt);
15 vfprintf(stderr, fmt, args);
16 va_end(args);
17 fprintf(stderr, "\n");
18 exit(1);
19 }
20
21 void diee (const char * fmt, ...) {
22 va_list args;
23
24 fflush(stdout);
25 va_start(args, fmt);
26 vfprintf(stderr, fmt, args);
27 va_end(args);
28
29 fprintf(stderr, " (%s)\n", strerror(errno));
30 exit(1);
31 }