web_deamon.cpp 647 B

12345678910111213141516171819202122
  1. #include "web_vendor.h"
  2. int main(int argc, char *argv[])
  3. {
  4. printf("enter\n");
  5. fflush(stdout);
  6. HTELINK_LOG_ENABLE(true);
  7. HTELINK_LOG_INFO("check env set");
  8. if (getenv(VENDOR_RUN_PATH_ENV) == nullptr) {
  9. HTELINK_LOG_INFO("execute env not set");
  10. std::string exe_dir = utils::get_executable_directory();
  11. setenv(VENDOR_RUN_PATH_ENV, exe_dir.c_str(), 1);
  12. }
  13. HTELINK_LOG_INFO("execute directory is %s", getenv(VENDOR_RUN_PATH_ENV));
  14. vendor::VendorBase *vdor = new WebVendor();
  15. if (vendor::VendorBase::ParseOptionArgs(vdor, argc, argv) != 0) {
  16. exit(-1);
  17. }
  18. return vdor->Exec();
  19. }