Import Upstream version 1.8.5
[hcoop/debian/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 #include <roken.h>
14
15 #include <afs/afsutil.h>
16 #include <afs/com_err.h>
17
18 #ifndef AFS_PTHREAD_ENV
19 #include <afs/kautils.h>
20 #include <rx/rxkad.h>
21 #include <afs/auth.h>
22 #include <afs/cellconfig.h>
23 #include <afs/cmd.h>
24 #include <afs/vlserver.h>
25 #include <afs/afsint.h>
26 #include "volser.h"
27 #endif
28
29 #ifndef AFS_PTHREAD_ENV
30 /*@printflike@*/ void
31 Log(const char *format, ...)
32 {
33 va_list args;
34
35 va_start(args, format);
36 vViceLog(0, (format, args));
37 va_end(args);
38 }
39 #endif
40
41 void
42 LogError(afs_int32 errcode)
43 {
44 ViceLog(0,
45 ("%s: %s\n", afs_error_table_name(errcode), afs_error_message(errcode)));
46 }
47
48 #ifndef AFS_PTHREAD_ENV
49 /*@printflike@*/ void
50 Abort(const char *format, ...)
51 {
52 va_list args;
53
54 ViceLog(0, ("Program aborted: "));
55 va_start(args, format);
56 vViceLog(0, (format, args));
57 va_end(args);
58 abort();
59 }
60 #endif
61
62 void
63 InitErrTabs(void)
64 {
65 #ifndef AFS_PTHREAD_ENV
66 initialize_KA_error_table();
67 initialize_RXK_error_table();
68 initialize_KTC_error_table();
69 initialize_ACFG_error_table();
70 initialize_CMD_error_table();
71 initialize_VL_error_table();
72 initialize_VOLS_error_table();
73 #endif
74 return;
75 }