Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Friday, October 16, 2026

Diff for ep/src/conf.c between version 1.36 and 1.37

version 1.36, 2002/10/03 15:50:06 version 1.37, 2002/10/03 16:03:31
Line 292  conf_parse_all(argc, argv)
Line 292  conf_parse_all(argc, argv)
   
                 msg_debug_print("verbose = %d\n", global->verbose);                  msg_debug_print("verbose = %d\n", global->verbose);
   
                 for (dbg_i = 0; processes != NULL && processes[dbg_i] != NULL; dbg_i++) {                  for (dbg_i = 0; processes != NULL && processes[dbg_i] != NULL;
                                   dbg_i++) {
   
                         if (processes[dbg_i]->name != NULL)                          if (processes[dbg_i]->name != NULL)
                                 names = strdyn_implode_str(processes[dbg_i]->name, ", ");                                  names = PLATON_FUNC(strdyn_implode_str)
                                           (processes[dbg_i]->name, ", ");
                         else                          else
                                 names = strdup("-- N/A --");                                  names = strdup("-- N/A --");
   
                         if (processes[dbg_i]->argv != NULL)                          if (processes[dbg_i]->argv != NULL)
                                 argvs = strdyn_implode_str(processes[dbg_i]->argv, " ");                                  argvs = PLATON_FUNC(strdyn_implode_str)
                                           (processes[dbg_i]->argv, " ");
                         else                          else
                                 argvs = strdup("-- N/A --");                                  argvs = strdup("-- N/A --");
   
Line 741  free_global(global)
Line 744  free_global(global)
         if (*global == NULL)          if (*global == NULL)
                 return;                  return;
   
         strdyn_safe_free((*global)->config_file);          PLATON_FUNC(strdyn_safe_free)((*global)->config_file);
   
         free(*global);          free(*global);
         *global = NULL;          *global = NULL;
Line 757  free_processes(processes)
Line 760  free_processes(processes)
                 return;                  return;
   
         for (i = 0; (*processes)[i] != NULL; i++) {          for (i = 0; (*processes)[i] != NULL; i++) {
                 strdyn_safe_free((*processes)[i]->name);                  PLATON_FUNC(strdyn_safe_free)((*processes)[i]->name);
                 strdyn_safe_free((*processes)[i]->argv);                  PLATON_FUNC(strdyn_safe_free)((*processes)[i]->argv);
   
                 for (j = 0; j < N_FD; j++)                  for (j = 0; j < N_FD; j++)
                         strdyn_safe_free((*processes)[i]->fd_str[j]);                          PLATON_FUNC(strdyn_safe_free)((*processes)[i]->fd_str[j]);
   
                 free((*processes)[i]);                  free((*processes)[i]);
         }          }
Line 779  get_processes_index_by_name(processes, n
Line 782  get_processes_index_by_name(processes, n
   
         for (i = 0; processes != NULL && processes[i] != NULL; i++)          for (i = 0; processes != NULL && processes[i] != NULL; i++)
                 if (processes[i]->name != NULL                  if (processes[i]->name != NULL
                                 && ! strdyn_casecmp(processes[i]->name, name))                                  && ! PLATON_FUNC(strdyn_casecmp)(processes[i]->name, name))
                         return i;                          return i;
   
         return -1;          return -1;
Line 920  add_processes_to_proctable(p_ptbl, proce
Line 923  add_processes_to_proctable(p_ptbl, proce
   
                 new_ptbl[i]->pid  = 0;                  new_ptbl[i]->pid  = 0;
                 new_ptbl[i]->nice = processes[i]->nice;                  new_ptbl[i]->nice = processes[i]->nice;
                 new_ptbl[i]->name = strdyn_safe_duplicate(processes[i]->name);                  new_ptbl[i]->name = PLATON_FUNC(strdyn_safe_duplicate)
                 new_ptbl[i]->argv = strdyn_safe_duplicate(processes[i]->argv);                          (processes[i]->name);
                   new_ptbl[i]->argv = PLATON_FUNC(strdyn_safe_duplicate)
                           (processes[i]->argv);
   
                 /* Converting filedescriptors strings to indexes. */                  /* Converting filedescriptors strings to indexes. */
                 for (j = 0; j < N_FD; j++) {                  for (j = 0; j < N_FD; j++) {
                         register int size = processes[i]->fd_str[j] == NULL                          register int size = processes[i]->fd_str[j] == NULL
                                 ? 0 : strdyn_get_size(processes[i]->fd_str[j]);                                  ? 0 : PLATON_FUNC(strdyn_get_size)(processes[i]->fd_str[j]);
   
                         new_ptbl[i]->fd[j].n_link  = 0;                          new_ptbl[i]->fd[j].n_link  = 0;
                         new_ptbl[i]->fd[j].pipe[0] = 0;                          new_ptbl[i]->fd[j].pipe[0] = 0;
Line 940  add_processes_to_proctable(p_ptbl, proce
Line 945  add_processes_to_proctable(p_ptbl, proce
                                 if (strlen(processes[i]->fd_str[j][k]) <= 0)                                  if (strlen(processes[i]->fd_str[j][k]) <= 0)
                                         continue;                                          continue;
   
                                 ar = strdyn_explode2_ar(processes[i]->fd_str[j][k],                                  ar = PLATON_FUNC(strdyn_explode2_ar)(processes[i]->fd_str[j][k],
                                                 name_vs_stream_separator);                                                  name_vs_stream_separator);
   
                                 if (ar == NULL) {                                  if (ar == NULL) {
Line 950  add_processes_to_proctable(p_ptbl, proce
Line 955  add_processes_to_proctable(p_ptbl, proce
                                         return -1;                                          return -1;
                                 }                                  }
   
                                 switch (strdyn_get_size(ar)) {                                  switch (PLATON_FUNC(strdyn_get_size)(ar)) {
                                         case 1:                                          case 1:
                                                 link.proc_id = 0;                                                  link.proc_id = 0;
                                                 fd_str = ar[0];                                                  fd_str = ar[0];
Line 993  add_processes_to_proctable(p_ptbl, proce
Line 998  add_processes_to_proctable(p_ptbl, proce
   
                                                         msg_error_print("bad process number '%s'\n", ar[0]);                                                          msg_error_print("bad process number '%s'\n", ar[0]);
                                                         proctable_destroy(&new_ptbl);                                                          proctable_destroy(&new_ptbl);
                                                         strdyn_free(ar);                                                          PLATON_FUNC(strdyn_free)(ar);
                                                         return -1;                                                          return -1;
                                                 }                                                  }
   
Line 1034  add_processes_to_proctable(p_ptbl, proce
Line 1039  add_processes_to_proctable(p_ptbl, proce
   
                                                 msg_error_print("bad process name '%s'\n", ar[0]);                                                  msg_error_print("bad process name '%s'\n", ar[0]);
                                                 proctable_destroy(&new_ptbl);                                                  proctable_destroy(&new_ptbl);
                                                 strdyn_free(ar);                                                  PLATON_FUNC(strdyn_free)(ar);
                                                 return -1;                                                  return -1;
   
                                         default:                                          default:
                                                 msg_error_print("bad link specification: %s\n",                                                  msg_error_print("bad link specification: %s\n",
                                                                 processes[i]->fd_str[j][k]);                                                                  processes[i]->fd_str[j][k]);
                                                 proctable_destroy(&new_ptbl);                                                  proctable_destroy(&new_ptbl);
                                                 strdyn_free(ar);                                                  PLATON_FUNC(strdyn_free)(ar);
                                                 return -1;                                                  return -1;
                                 }                                  }
   
                                 link.fd_id = fd_str_to_fd_id(fd_str);                                  link.fd_id = fd_str_to_fd_id(fd_str);
                                 strdyn_free(ar); /* fd_str points to ar[] */                                  PLATON_FUNC(strdyn_free)(ar); /* fd_str points to ar[] */
                                 if (link.fd_id < 0) {                                  if (link.fd_id < 0) {
                                         msg_error_print("bad stream specification '%s'\n", fd_str);                                          msg_error_print("bad stream specification '%s'\n", fd_str);
                                         proctable_destroy(&new_ptbl);                                          proctable_destroy(&new_ptbl);

Legend:
Removed from v.1.36  
changed lines
  Added in v.1.37

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top