~ubuntu-branches/ubuntu/oneiric/openafs/oneiric-201305130334

« back to all changes in this revision

Viewing changes to src/vlserver/cnvldb.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/vlserver/cnvldb.c,v 1.9 2003/07/15 23:17:33 shadow Exp $");
 
14
    ("$Header: /cvs/openafs/src/vlserver/cnvldb.c,v 1.9.2.4 2007/12/09 23:37:17 shadow Exp $");
15
15
 
16
16
#include <afs/stds.h>
17
17
#include <sys/types.h>
18
18
#include <errno.h>
19
19
#include <stdio.h>
20
20
#include <sys/file.h>
21
 
 
22
 
#ifdef HAVE_STRING_H
23
21
#include <string.h>
24
 
#else
25
 
#ifdef HAVE_STRINGS_H
26
 
#include <strings.h>
27
 
#endif
28
 
#endif
29
22
 
30
23
#include "cnvldb.h"             /* CHANGEME! */
31
24
#include <netinet/in.h>
40
33
#define BADSERVERID     255     /* XXX */
41
34
 
42
35
 
43
 
extern struct cmd_syndesc *cmd_CreateSyntax();
44
36
static char pn[] = "cnvldb";
45
37
static char tempname[] = "XXnewvldb";
46
38
static char space[MAXSIZE];
52
44
static int rewrite_header();
53
45
 
54
46
static char tspace[1024];       /* chdir can't handle anything bigger, anyway */
 
47
 
 
48
void read_mhentries(afs_uint32 mh_addr, int oldfd);
 
49
void convert_mhentries(int oldfd, int newfd, struct vlheader_2 *header, int fromver, int tover);
 
50
 
55
51
/* return a static pointer to a buffer */
56
52
static char *
57
53
Parent(apath)
74
70
char *pathname = NULL;
75
71
const char *dbPath;
76
72
 
77
 
static
78
 
handleit(as)
79
 
     struct cmd_syndesc *as;
 
73
static int
 
74
handleit(struct cmd_syndesc *as, void *arock)
80
75
{
81
76
    register struct cmd_item *ti;
82
77
    register afs_int32 code;
366
361
 * verifying their address is not pass the EOF and the flags are good.
367
362
 * If it's not good, then don't read the block in.
368
363
 */
 
364
void
369
365
read_mhentries(mh_addr, oldfd)
370
366
     int oldfd;
371
367
     afs_uint32 mh_addr;
472
468
 * 
473
469
 * Before this can be called, the routine read_mhentries must be called.
474
470
 */
 
471
void
475
472
convert_mhentries(oldfd, newfd, header, fromver, tover)
476
473
     int oldfd, newfd;
477
474
     struct vlheader_2 *header;
997
994
    register struct cmd_syndesc *ts;
998
995
    afs_int32 code;
999
996
 
1000
 
    ts = cmd_CreateSyntax("initcmd", handleit, 0, "optional");
 
997
    ts = cmd_CreateSyntax("initcmd", handleit, NULL, "optional");
1001
998
    cmd_AddParm(ts, "-to", CMD_SINGLE, CMD_OPTIONAL, "goal version");
1002
999
    cmd_AddParm(ts, "-from", CMD_SINGLE, CMD_OPTIONAL, "current version");
1003
1000
    cmd_AddParm(ts, "-path", CMD_SINGLE, CMD_OPTIONAL, "pathname");