]> skyeroc.xyz Git - dgamelaunch/commitdiff
Pull C99 initializers that don't work with Sun compiler :(
authorJoshua Kwan <joshk@triplehelix.org>
Fri, 30 Jan 2004 17:32:12 +0000 (17:32 +0000)
committerJoshua Kwan <joshk@triplehelix.org>
Fri, 30 Jan 2004 17:32:12 +0000 (17:32 +0000)
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@191 db0b04b0-f4d1-0310-9a6d-de3e77497b0e

dgamelaunch.c

index c99b8099983a7357e65e9cc20559bbb6918cd245..80f29b95b9e61de3bfb86af7ad4c82ff7b9e0228 100644 (file)
@@ -93,17 +93,19 @@ struct dg_config *myconfig = NULL;
 char* config = NULL;
 
 struct dg_config defconfig = {
-  .chroot = "/var/lib/dgamelaunch/",
-  .nethack = "/bin/nethack",
-  .dglroot = "/dgldir/",
-  .lockfile = "/dgl-lock",
-  .passwd = "/dgl-login",
-  .banner = "/dgl-banner",
-  .rcfile = "/dgl-default-rcfile",
-  .spool = "/var/mail/",
-  .shed_user = "games", .shed_group = "games",
-  .shed_uid = 5, .shed_gid = 60, /* games:games in Debian */
-  .max = 64000 
+  /* chroot = */ "/var/lib/dgamelaunch/",
+  /* nethack = */ "/bin/nethack",
+  /* dglroot = */  "/dgldir/",
+  /* lockfile = */ "/dgl-lock",
+  /* passwd = */ "/dgl-login",
+  /* banner = */ "/dgl-banner",
+  /* rcfile = */ "/dgl-default-rcfile",
+  /* spool = */ "/var/mail/",
+  /* shed_user = */ "games",
+  /* shed_group = */ "games",
+  /* shed_uid = */ 5,
+  /* shed_gid = */ 60, /* games:games in Debian */
+  /* max = */ 64000 
 };
 
 int loggedin = 0;
@@ -237,15 +239,15 @@ gen_inprogress_lock (pid_t pid, char* ttyrec_filename)
   char *lockfile = NULL, pidbuf[16];
   int fd;
   size_t len;
-  struct flock fl = {
-    .l_type = F_WRLCK,
-    .l_whence = SEEK_SET,
-    .l_start = 0,
-    .l_len = 0
-  };
+  struct flock fl = { 0 };
 
   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;
   lockfile = calloc(len, sizeof(char));
   
@@ -381,14 +383,14 @@ populate_games (int *l)
   char fullname[130], ttyrecname[130];
   char *replacestr, *dir;
   struct dg_game **games = NULL;
-  struct flock fl = {
-    .l_type = F_WRLCK,
-    .l_whence = SEEK_SET,
-    .l_start = 0,
-    .l_len = 0
-  };
+  struct flock fl = { 0 };
   size_t slen;
 
+  fl.l_type = F_WRLCK;
+  fl.l_whence = SEEK_SET;
+  fl.l_start = 0;
+  fl.l_len = 0;
+
   len = 0;
   
   slen = strlen(myconfig->dglroot) + ARRAY_SIZE("inprogress/") + 1;
@@ -624,12 +626,12 @@ domailuser (char *username)
   FILE *user_spool = NULL;
   time_t now;
   int mail_empty = 1;
-  struct flock fl = {
-    .l_type = F_WRLCK,
-    .l_whence = SEEK_SET,
-    .l_start = 0,
-    .l_len = 0
-  };
+  struct flock fl = { 0 };
+
+  fl.l_type = F_WRLCK;
+  fl.l_whence = SEEK_SET;
+  fl.l_start = 0;
+  fl.l_len = 0;
 
   assert (loggedin);
 
@@ -993,14 +995,14 @@ readfile (int nolock)
 {
   FILE *fp = NULL, *fpl = NULL;
   char buf[1200];
-  struct flock fl = {
-    .l_type = F_RDLCK,
-    .l_whence = SEEK_SET,
-    .l_start = 0,
-    .l_len = 0
-  };
+  struct flock fl = { 0 };
 
-  memset (buf, 1200, 0);
+  fl.l_type = F_RDLCK;
+  fl.l_whence = SEEK_SET;
+  fl.l_start = 0;
+  fl.l_len = 0;
+
+  memset (buf, 1024, 0);
 
   /* read new stuff */
 
@@ -1206,12 +1208,12 @@ writefile (int requirenew)
   FILE *fp, *fpl;
   int i = 0;
   int my_done = 0;
-  struct flock fl = { 
-    .l_type = F_WRLCK,
-    .l_whence = SEEK_SET,
-    .l_start = 0,
-    .l_len = 0
-  };
+  struct flock fl = { 0 };
+
+  fl.l_type = F_WRLCK;
+  fl.l_whence = SEEK_SET;
+  fl.l_start = 0;
+  fl.l_len = 0;
 
   fpl = fopen (myconfig->lockfile, "r+");
   if (!fpl)