~ubuntu-branches/ubuntu/karmic/openafs/karmic-updates

« back to all changes in this revision

Viewing changes to src/budb/server.c

  • Committer: Bazaar Package Importer
  • Author(s): Russ Allbery
  • Date: 2008-09-22 19:07:02 UTC
  • mfrom: (12.1.14 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080922190702-59m13d7kn6gkw32d
Tags: 1.4.7.dfsg1-6
* Apply upstream patch to free /proc entries in the correct order.
  Thanks, Marc Dionne.  (Closes: #493914)
* Apply upstream deltas to support 2.6.27 kernels and to stop using
  COMMON_KERN_CFLAGS for all 2.6 kernels uniformly, which fixes
  problems on amd64 with newer kernels.  Thanks, Björn Torkelsson.
  (LP: #267504)
* Translation updates:
  - Swedish, thanks Martin Bagge.  (Closes: #493120)

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
#include <afs/param.h>
12
12
 
13
13
RCSID
14
 
    ("$Header: /cvs/openafs/src/budb/server.c,v 1.14.2.4 2006/06/20 20:35:00 jaltman Exp $");
 
14
    ("$Header: /cvs/openafs/src/budb/server.c,v 1.14.2.9 2008/03/10 22:35:34 shadow Exp $");
15
15
 
16
16
#include <fcntl.h>
17
17
#include <sys/stat.h>
24
24
#include <sys/time.h>
25
25
#include <netdb.h>
26
26
#endif
27
 
 
28
 
#ifdef HAVE_STRING_H
29
27
#include <string.h>
30
 
#else
31
 
#ifdef HAVE_STRINGS_H
32
 
#include <strings.h>
33
 
#endif
34
 
#endif
35
 
 
36
28
#include <afs/stds.h>
37
29
#include <sys/types.h>
38
30
#include <time.h>
62
54
struct ubik_dbase *BU_dbase;
63
55
struct afsconf_dir *BU_conf;    /* for getting cell info */
64
56
 
 
57
int argHandler(struct cmd_syndesc *, void *);
 
58
 
65
59
char lcell[MAXKTCREALMLEN];
66
60
afs_int32 myHost = 0;
67
61
int helpOption;
131
125
 *      If it were, this routine would never have been called.
132
126
 */
133
127
static int
134
 
MyBeforeProc(as)
135
 
     register struct cmd_syndesc *as;
 
128
MyBeforeProc(register struct cmd_syndesc *as, void *arock)
136
129
{
137
130
    helpOption = 0;
138
131
    return 0;
142
135
 *      initialize all the supported commands and their arguments
143
136
 */
144
137
 
 
138
void
145
139
initializeArgHandler()
146
140
{
147
141
    struct cmd_syndesc *cptr;
148
142
 
149
 
    int argHandler();
150
 
 
151
143
    cmd_SetBeforeProc(MyBeforeProc, NULL);
152
144
 
153
145
    cptr = cmd_CreateSyntax(NULL, argHandler, NULL, "Backup database server");
179
171
}
180
172
 
181
173
int
182
 
argHandler(as, arock)
183
 
     struct cmd_syndesc *as;
184
 
     char *arock;
 
174
argHandler(struct cmd_syndesc *as, void *arock)
185
175
{
186
176
 
187
177
    /* globalConfPtr provides the handle for the configuration information */
410
400
#ifdef AFS_NT40_ENV
411
401
        ReportErrorEventAlt(AFSEVT_SVR_NO_INSTALL_DIR, 0, argv[0], 0);
412
402
#endif
413
 
        com_err(whoami, errno, "; Unable to obtain AFS server directory.");
 
403
        afs_com_err(whoami, errno, "; Unable to obtain AFS server directory.");
414
404
        exit(2);
415
405
    }
416
406
 
468
458
    BU_conf = afsconf_Open(globalConfPtr->cellConfigdir);
469
459
    if (BU_conf == 0) {
470
460
        LogError(code, "Failed getting cell info\n");
471
 
        com_err(whoami, code, "Failed getting cell info");
 
461
        afs_com_err(whoami, code, "Failed getting cell info");
472
462
        ERROR(BUDB_NOCELLS);
473
463
    }
474
464
 
551
541
 
552
542
    if (code) {
553
543
        LogError(code, "Ubik init failed\n");
554
 
        com_err(whoami, code, "Ubik init failed");
 
544
        afs_com_err(whoami, code, "Ubik init failed");
555
545
        ERROR(code);
556
546
    }
557
547
 
595
585
    currentTime = time(0);
596
586
    LogError(0, "Ready to process requests at %s\n", ctime(&currentTime));
597
587
 
598
 
    rx_ServerProc();            /* donate this LWP */
 
588
    rx_ServerProc(NULL);                /* donate this LWP */
599
589
 
600
590
  error_exit:
601
591
    osi_audit(BUDB_FinishEvent, code, AUD_END);
602
592
    return (code);
603
593
}
604
594
 
605
 
 
 
595
void
606
596
consistencyCheckDb()
607
597
{
608
598
    /* do consistency checks on structure sizes */
678
668
        fprintf(globalConfPtr->log, "%s ", TimeStamp(now));
679
669
 
680
670
        if (code)
681
 
            fprintf(globalConfPtr->log, "%s: %s\n", error_table_name(code),
682
 
                    error_message(code));
 
671
            fprintf(globalConfPtr->log, "%s: %s\n", afs_error_table_name(code),
 
672
                    afs_error_message(code));
683
673
        fprintf(globalConfPtr->log, a, b, c, d, e, f, g, h, i);
684
674
        fflush(globalConfPtr->log);
685
675
        fclose(globalConfPtr->log);