Пример #1
0
lagopus_result_t
lagopus_module_initialize_all(int argc, const char *const argv[]) {
  lagopus_result_t ret = LAGOPUS_RESULT_ANY_FAILURES;

  s_lock();
  {
    if (s_n_modules > 0) {
      size_t i;
      a_module *mptr;

      for (ret = LAGOPUS_RESULT_OK, i = 0;
           ret == LAGOPUS_RESULT_OK && i < s_n_modules;
           i++) {
        mptr = &(s_modules[i]);
        ret = s_initialize_module(mptr, argc, argv);
        if (ret != LAGOPUS_RESULT_OK) {
          lagopus_perror(ret);
          lagopus_msg_error("can't initialize module \"%s\".\n",
                            mptr->m_name);
        }
      }
    } else {
      ret = LAGOPUS_RESULT_OK;
    }
  }
  s_unlock();

  return ret;
}
Пример #2
0
gallus_result_t
gallus_module_initialize_all(int argc, const char *const argv[]) {
  gallus_result_t ret = GALLUS_RESULT_ANY_FAILURES;

  s_lock();
  {

    if (s_n_modules > 0) {
      size_t i;
      a_module *mptr;

      s_gstate = MODULE_GLOBAL_STATE_INITIALIZING;

      for (ret = GALLUS_RESULT_OK, i = 0;
           ret == GALLUS_RESULT_OK && i < s_n_modules;
           i++) {
        mptr = &(s_modules[i]);
        ret = s_initialize_module(mptr, argc, argv);
        if (ret != GALLUS_RESULT_OK) {
          gallus_perror(ret);
          gallus_msg_error("can't initialize module \"%s\".\n",
                            mptr->m_name);
        }
      }
    } else {
      ret = GALLUS_RESULT_OK;
    }

    if (ret == GALLUS_RESULT_OK) {
      s_gstate = MODULE_GLOBAL_STATE_INITIALIZED;
    }

  }
  s_unlock();

  return ret;
}