DEVEL15-vol-split-nearino-20090324
[openafs.git] / src / volser / 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 #include <afsconfig.h>
11 #include <afs/param.h>
12
13 RCSID
14     ("$Header$");
15
16 #include <stdio.h>
17 #include <afs/afsutil.h>
18 #include <afs/com_err.h>
19
20 #ifndef AFS_PTHREAD_ENV
21 /*@printflike@*/ void
22 Log(const char *format, ...)
23 {
24     va_list args;
25
26     va_start(args, format);
27     vViceLog(0, (format, args));
28     va_end(args);
29 }
30 #endif
31
32 void
33 LogError(afs_int32 errcode)
34 {
35     ViceLog(0,
36             ("%s: %s\n", afs_error_table_name(errcode), afs_error_message(errcode)));
37 }
38
39 #ifndef AFS_PTHREAD_ENV
40 /*@printflike@*/ void
41 Abort(const char *format, ...)
42 {
43     va_list args;
44
45     ViceLog(0, ("Program aborted: "));
46     va_start(args, format);
47     vViceLog(0, (format, args));
48     va_end(args);
49     abort();
50 }
51 #endif
52
53 void
54 InitErrTabs(void)
55 {
56 #ifndef AFS_PTHREAD_ENV
57     initialize_KA_error_table();
58     initialize_RXK_error_table();
59     initialize_KTC_error_table();
60     initialize_ACFG_error_table();
61     initialize_CMD_error_table();
62     initialize_VL_error_table();
63     initialize_VOLS_error_table();
64 #endif
65     return;
66 }