Преглед изворни кода

* init_conf -> init_conffile

svn: 1793
Bryan Drewery пре 21 година
родитељ
комит
697492b4bc
3 измењених фајлова са 6 додато и 7 уклоњено
  1. 1 1
      src/conf.c
  2. 1 1
      src/conf.h
  3. 4 5
      src/main.c

+ 1 - 1
src/conf.c

@@ -265,7 +265,7 @@ fatal:
 #endif /* !CYGWIN_HACKS */
 #endif /* !CYGWIN_HACKS */
 
 
 void
 void
-init_conf()
+init_conffile()
 {
 {
   conffile.bots = (conf_bot *) my_calloc(1, sizeof(conf_bot));
   conffile.bots = (conf_bot *) my_calloc(1, sizeof(conf_bot));
   conffile.bots->nick = NULL;
   conffile.bots->nick = NULL;

+ 1 - 1
src/conf.h

@@ -66,7 +66,7 @@ void conf_addbot(char *, char *, char *, char *);
 int conf_delbot(char *);
 int conf_delbot(char *);
 #endif /* LEAF */
 #endif /* LEAF */
 pid_t checkpid(char *, conf_bot *);
 pid_t checkpid(char *, conf_bot *);
-void init_conf();
+void init_conffile();
 void free_conffile();
 void free_conffile();
 int readconf(const char *, int);
 int readconf(const char *, int);
 int parseconf(bool);
 int parseconf(bool);

+ 4 - 5
src/main.c

@@ -682,6 +682,7 @@ int main(int argc, char **argv)
   timer_update_now(&egg_timeval_now);
   timer_update_now(&egg_timeval_now);
   now = egg_timeval_now.sec;
   now = egg_timeval_now.sec;
   mypid = getpid();
   mypid = getpid();
+  myuid = geteuid();
 
 
   srandom(now % (mypid + getppid()) * randint(1000));
   srandom(now % (mypid + getppid()) * randint(1000));
 
 
@@ -712,7 +713,6 @@ printf("out: %s\n", out);
 
 
   check_sum(binname, argc >= 3 && !strcmp(argv[1], "-p") ? argv[2] : NULL);
   check_sum(binname, argc >= 3 && !strcmp(argv[1], "-p") ? argv[2] : NULL);
   // Now settings struct is decrypted
   // Now settings struct is decrypted
-
   if (!checked_bin_buf)
   if (!checked_bin_buf)
     exit(1);
     exit(1);
 
 
@@ -725,14 +725,14 @@ printf("out: %s\n", out);
   }
   }
 #endif
 #endif
 
 
+  init_conffile();			/* establishes conffile and sets to defaults */
+
   /* Version info! */
   /* Version info! */
   egg_snprintf(ver, sizeof ver, "[%s] Wraith %s", settings.packname, egg_version);
   egg_snprintf(ver, sizeof ver, "[%s] Wraith %s", settings.packname, egg_version);
   egg_snprintf(version, sizeof version, "[%s] Wraith %s (%lu)", settings.packname, egg_version, buildts);
   egg_snprintf(version, sizeof version, "[%s] Wraith %s (%lu)", settings.packname, egg_version, buildts);
 
 
-  Context;
   egg_memcpy(&nowtm, gmtime(&now), sizeof(struct tm));
   egg_memcpy(&nowtm, gmtime(&now), sizeof(struct tm));
   lastmin = nowtm.tm_min;
   lastmin = nowtm.tm_min;
-  myuid = geteuid();
 
 
 #ifdef HUB
 #ifdef HUB
   egg_snprintf(tempdir, sizeof tempdir, "%s/tmp/", confdir());
   egg_snprintf(tempdir, sizeof tempdir, "%s/tmp/", confdir());
@@ -745,13 +745,12 @@ printf("out: %s\n", out);
 #endif /* CYGWIN_HACKS */
 #endif /* CYGWIN_HACKS */
   clear_tmp();		/* clear out the tmp dir, no matter if we are localhub or not */
   clear_tmp();		/* clear out the tmp dir, no matter if we are localhub or not */
 
 
-  init_conf();			/* establishes conffile and sets to defaults */
   if (argc) {
   if (argc) {
     sdprintf("Calling dtx_arg with %d params.", argc);
     sdprintf("Calling dtx_arg with %d params.", argc);
     dtx_arg(argc, argv);
     dtx_arg(argc, argv);
   }
   }
 
 
-  sdprintf("my euid: %d my uuid: %d, my ppid: %d my pid: %d", geteuid(), myuid, getppid(), mypid);
+  sdprintf("my euid: %d my uuid: %d, my ppid: %d my pid: %d", myuid, getuid(), getppid(), mypid);
 
 
 #ifndef CYGWIN_HACKS
 #ifndef CYGWIN_HACKS
   if (checktrace)
   if (checktrace)