forked from 7jXlqS-hmpBUGsK/iscabbs-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutility.c
61 lines (51 loc) · 1.01 KB
/
utility.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include "defs.h"
#include "ext.h"
int
openfiles(void)
{
size_t size;
size = sizeof(struct bigbtmp);
if (!(bigbtmp = (struct bigbtmp *)mmap_file(TMPDATA, &size)))
{
my_printf ("btmp\n");
return(-1);
}
#if 1
size = MM_FILELEN;
if (!(msgstart = mmap_file(MSGMAIN, &size)))
#else
size = 0;
/* Want to set msgsize or whatever to size */
if (!(msgstart = mmap_file(MSGMAIN, &size)))
#endif
{
my_printf ("msgmain\n");
return(-1);
}
/* madvise((void *)msgstart, size, 0); */
size = sizeof(struct msg);
if (!(msg = (struct msg *)mmap_file(MSGDATA, &size)))
{
my_printf ("msgdata\n");
return(-1);
}
size = 0;
if (!(xmsg = mmap_file(XMSGDATA, &size)))
{
my_printf ("xmsgdata\n");
return(-1);
}
/* madvise((void *)xmsg, size, 0); */
size = 0;
if (!(voteinfo = (struct voteinfo *) mmap_file (VOTEFILE, &size)))
{
my_printf ("voteinfo problem\n");
return -1;
}
if (openuser() < 0)
{
my_printf ("openuser\n");
return(-1);
}
return(0);
}