mirror of
https://github.com/paxed/dgamelaunch.git
synced 2025-07-27 07:34:44 +02:00
C99 initializers everywhere!
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@190 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
parent
d9fc32fa02
commit
fb02d3614b
@ -237,15 +237,15 @@ gen_inprogress_lock (pid_t pid, char* ttyrec_filename)
|
|||||||
char *lockfile = NULL, pidbuf[16];
|
char *lockfile = NULL, pidbuf[16];
|
||||||
int fd;
|
int fd;
|
||||||
size_t len;
|
size_t len;
|
||||||
struct flock fl = { 0 };
|
struct flock fl = {
|
||||||
|
.l_type = F_WRLCK,
|
||||||
|
.l_whence = SEEK_SET,
|
||||||
|
.l_start = 0,
|
||||||
|
.l_len = 0
|
||||||
|
};
|
||||||
|
|
||||||
snprintf (pidbuf, 16, "%d", pid);
|
snprintf (pidbuf, 16, "%d", pid);
|
||||||
|
|
||||||
fl.l_type = F_WRLCK;
|
|
||||||
fl.l_whence = SEEK_SET;
|
|
||||||
fl.l_start = 0;
|
|
||||||
fl.l_len = 0;
|
|
||||||
|
|
||||||
len = strlen(myconfig->dglroot) + strlen(me->username) + strlen(ttyrec_filename) + 13;
|
len = strlen(myconfig->dglroot) + strlen(me->username) + strlen(ttyrec_filename) + 13;
|
||||||
lockfile = calloc(len, sizeof(char));
|
lockfile = calloc(len, sizeof(char));
|
||||||
|
|
||||||
@ -381,14 +381,14 @@ populate_games (int *l)
|
|||||||
char fullname[130], ttyrecname[130];
|
char fullname[130], ttyrecname[130];
|
||||||
char *replacestr, *dir;
|
char *replacestr, *dir;
|
||||||
struct dg_game **games = NULL;
|
struct dg_game **games = NULL;
|
||||||
struct flock fl = { 0 };
|
struct flock fl = {
|
||||||
|
.l_type = F_WRLCK,
|
||||||
|
.l_whence = SEEK_SET,
|
||||||
|
.l_start = 0,
|
||||||
|
.l_len = 0
|
||||||
|
};
|
||||||
size_t slen;
|
size_t slen;
|
||||||
|
|
||||||
fl.l_type = F_WRLCK;
|
|
||||||
fl.l_whence = SEEK_SET;
|
|
||||||
fl.l_start = 0;
|
|
||||||
fl.l_len = 0;
|
|
||||||
|
|
||||||
len = 0;
|
len = 0;
|
||||||
|
|
||||||
slen = strlen(myconfig->dglroot) + ARRAY_SIZE("inprogress/") + 1;
|
slen = strlen(myconfig->dglroot) + ARRAY_SIZE("inprogress/") + 1;
|
||||||
@ -624,12 +624,12 @@ domailuser (char *username)
|
|||||||
FILE *user_spool = NULL;
|
FILE *user_spool = NULL;
|
||||||
time_t now;
|
time_t now;
|
||||||
int mail_empty = 1;
|
int mail_empty = 1;
|
||||||
struct flock fl = { 0 };
|
struct flock fl = {
|
||||||
|
.l_type = F_WRLCK,
|
||||||
fl.l_type = F_WRLCK;
|
.l_whence = SEEK_SET,
|
||||||
fl.l_whence = SEEK_SET;
|
.l_start = 0,
|
||||||
fl.l_start = 0;
|
.l_len = 0
|
||||||
fl.l_len = 0;
|
};
|
||||||
|
|
||||||
assert (loggedin);
|
assert (loggedin);
|
||||||
|
|
||||||
@ -993,14 +993,14 @@ readfile (int nolock)
|
|||||||
{
|
{
|
||||||
FILE *fp = NULL, *fpl = NULL;
|
FILE *fp = NULL, *fpl = NULL;
|
||||||
char buf[1200];
|
char buf[1200];
|
||||||
struct flock fl = { 0 };
|
struct flock fl = {
|
||||||
|
.l_type = F_RDLCK,
|
||||||
|
.l_whence = SEEK_SET,
|
||||||
|
.l_start = 0,
|
||||||
|
.l_len = 0
|
||||||
|
};
|
||||||
|
|
||||||
fl.l_type = F_RDLCK;
|
memset (buf, 1200, 0);
|
||||||
fl.l_whence = SEEK_SET;
|
|
||||||
fl.l_start = 0;
|
|
||||||
fl.l_len = 0;
|
|
||||||
|
|
||||||
memset (buf, 1024, 0);
|
|
||||||
|
|
||||||
/* read new stuff */
|
/* read new stuff */
|
||||||
|
|
||||||
@ -1206,12 +1206,12 @@ writefile (int requirenew)
|
|||||||
FILE *fp, *fpl;
|
FILE *fp, *fpl;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int my_done = 0;
|
int my_done = 0;
|
||||||
struct flock fl = { 0 };
|
struct flock fl = {
|
||||||
|
.l_type = F_WRLCK,
|
||||||
fl.l_type = F_WRLCK;
|
.l_whence = SEEK_SET,
|
||||||
fl.l_whence = SEEK_SET;
|
.l_start = 0,
|
||||||
fl.l_start = 0;
|
.l_len = 0
|
||||||
fl.l_len = 0;
|
};
|
||||||
|
|
||||||
fpl = fopen (myconfig->lockfile, "r+");
|
fpl = fopen (myconfig->lockfile, "r+");
|
||||||
if (!fpl)
|
if (!fpl)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user