add AFS_DEMAND_ATTACH_UTIL
[openafs.git] / src / vol / common.c
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  *
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 /*
11         System:         VICE-TWO
12         Module:         common.c
13         Institution:    The Information Technology Center, Carnegie-Mellon University
14
15  */
16
17 #include <sys/types.h>
18 #include <stdio.h>
19 #include <stdlib.h>
20 #include <afsconfig.h>
21 #include <afs/param.h>
22
23
24 #include <afs/afsutil.h>
25
26 #include "common.h"
27
28 int Statistics = 0;
29
30 /*@printflike@*/ void
31 Log(const char *format, ...)
32 {
33     int level;
34     va_list args;
35
36     if (Statistics)
37         level = -1;
38     else
39         level = 0;
40
41     va_start(args, format);
42     vViceLog(level, (format, args));
43     va_end(args);
44 }
45
46 /*@printflike@*/ void
47 Abort(const char *format, ...)
48 {
49     va_list args;
50
51     ViceLog(0, ("Program aborted: "));
52     va_start(args, format);
53     vViceLog(0, (format, args));
54     va_end(args);
55     abort();
56 }
57
58 /*@printflike@*/ void
59 Quit(const char *format, ...)
60 {
61     va_list args;
62
63     va_start(args, format);
64     vViceLog(0, (format, args));
65     va_end(args);
66     exit(1);
67 }