软件著作权-源代码范本(3)
天一博胜企业管理软件V1.0 源代码
11
} #endif ns_os_chroot(ns_g_chrootdir); ns_os_minprivs(); result = ns_log_init(TYBS_TF(ns_g_username != NULL)); if (result != TYBS_R_SUCCESS) ns_main_earlyfatal(\ tybs_result_totext(result)); if (!ns_g_foreground) ns_os_daemonize(); result = tybs_app_start(); if (result != TYBS_R_SUCCESS) ns_main_earlyfatal(\ tybs_result_totext(result)); tybs_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_NOTICE, \ saved_command_line); tybs_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_NOTICE, \ (void)tybs_resource_getlimit(tybs_resource_stacksize, &ns_g_initstacksize); (void)tybs_resource_getlimit(tybs_resource_datasize, &ns_g_initdatasize); (void)tybs_resource_getlimit(tybs_resource_coresize, &ns_g_initcoresize); (void)tybs_resource_getlimit(tybs_resource_openfiles, &ns_g_initopenfiles); if (! tybs_file_isabsolute(ns_g_conffile)) { result = tybs_file_absolutepath(ns_g_conffile, absolute_conffile, sizeof(absolute_conffile)); if (result != TYBS_R_SUCCESS) ns_main_earlyfatal(\ \ tybs_result_totext(result)); ns_g_conffile = absolute_conffile; } result = tybs_time_now(&ns_g_boottime); if (result != TYBS_R_SUCCESS) ns_main_earlyfatal(\ tybs_result_totext(result)); result = create_managers(); if (result != TYBS_R_SUCCESS) ns_main_earlyfatal(\ tybs_result_totext(result)); ns_builtin_init(); #ifdef DLZ result = dlz_drivers_init(); if (result != TYBS_R_SUCCESS) ns_main_earlyfatal(\ tybs_result_totext(result)); #endif
天一博胜企业管理软件V1.0 源代码
12
ns_server_create(ns_g_mctx, &ns_g_server); }
static void
cleanup(void) { destroy_managers(); ns_server_destroy(&ns_g_server); ns_builtin_deinit(); #ifdef DLZ dlz_drivers_clear(); #endif dns_name_destroy(); tybs_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_NOTICE, \ ns_log_shutdown(); }
static char *memstats = NULL; void
ns_main_setmemstats(const char *filename) { if (memstats != NULL) { free(memstats); memstats = NULL; } if (filename == NULL) return; memstats = malloc(strlen(filename) + 1); if (memstats) strcpy(memstats, filename); }
#ifdef HAVE_LIBSCF tybs_result_t
ns_smf_get_instance(char **ins_name, int debug, tybs_mem_t *mctx) { scf_handle_t *h = NULL; int namelen; char *instance; REQUIRE(ins_name != NULL && *ins_name == NULL); if ((h = scf_handle_create(SCF_VERSION)) == NULL) { if (debug) UNEXPECTED_ERROR(__FILE__, __LINE__, \ scf_strerror(scf_error())); return (TYBS_R_FAILURE); } if (scf_handle_bind(h) == -1) { if (debug) UNEXPECTED_ERROR(__FILE__, __LINE__, \ scf_strerror(scf_error())); scf_handle_destroy(h); return (TYBS_R_FAILURE); } if ((namelen = scf_myname(h, NULL, 0)) == -1) { if (debug)
天一博胜企业管理软件V1.0 源代码
13
UNEXPECTED_ERROR(__FILE__, __LINE__, \ scf_strerror(scf_error())); scf_handle_destroy(h); return (TYBS_R_FAILURE); } if ((instance = tybs_mem_allocate(mctx, namelen + 1)) == NULL) { UNEXPECTED_ERROR(__FILE__, __LINE__, \ \ tybs_result_totext(TYBS_R_NOMEMORY)); scf_handle_destroy(h); return (TYBS_R_FAILURE); } if (scf_myname(h, instance, namelen + 1) == -1) { if (debug) UNEXPECTED_ERROR(__FILE__, __LINE__, \ scf_strerror(scf_error())); scf_handle_destroy(h); tybs_mem_free(mctx, instance); return (TYBS_R_FAILURE); } scf_handle_destroy(h); *ins_name = instance; return (TYBS_R_SUCCESS); }
#endif int
main(int argc, char *argv[]) { tybs_result_t result; #ifdef HAVE_LIBSCF char *instance = NULL; #endif strlcat(version, #ifdef __DATE__ \TE__ \#else \#endif sizeof(version)); result = tybs_file_progname(*argv, program_name, sizeof(program_name)); if (result != TYBS_R_SUCCESS) ns_main_earlyfatal(\ if (strcmp(program_name, \ ns_g_lwresdonly = TYBS_TRUE; tybs_assertion_setcallback(assertion_failed); tybs_error_setfatal(library_fatal_error); tybs_error_setunexpected(library_unexpected_error); ns_os_init(program_name); dns_result_register(); dst_result_register();
天一博胜企业管理软件V1.0 源代码
14
tybscc_result_register(); parse_command_line(argc, argv); if (ns_g_chrootdir != NULL) { int len = strlen(ns_g_chrootdir); if (strncmp(ns_g_chrootdir, ns_g_conffile, len) == 0 && (ns_g_conffile[len] == '/' || ns_g_conffile[len] == '\\\\')) ns_main_earlywarning(\ \ ns_g_conffile, ns_g_chrootdir); } result = tybs_mem_create(0, 0, &ns_g_mctx); if (result != TYBS_R_SUCCESS) ns_main_earlyfatal(\ tybs_result_totext(result)); tybs_mem_setname(ns_g_mctx, \ setup(); do { result = tybs_app_run(); if (result == TYBS_R_RELOAD) { ns_server_reloadwanted(ns_g_server); } else if (result != TYBS_R_SUCCESS) { UNEXPECTED_ERROR(__FILE__, __LINE__, \ tybs_result_totext(result)); result = TYBS_R_SUCCESS; } } while (result != TYBS_R_SUCCESS); #ifdef HAVE_LIBSCF if (ns_smf_want_disable == 1) { result = ns_smf_get_instance(&instance, 1, ns_g_mctx); if (result == TYBS_R_SUCCESS && instance != NULL) { if (smf_disable_instance(instance, 0) != 0) UNEXPECTED_ERROR(__FILE__, __LINE__, \ \ instance, scf_strerror(scf_error())); } if (instance != NULL) tybs_mem_free(ns_g_mctx, instance); }
#endif /* HAVE_LIBSCF */ cleanup(); if (want_stats) { tybs_mem_stats(ns_g_mctx, stdout); tybs_mutex_stats(stdout); } if (ns_g_memstatistics && memstats != NULL) { FILE *fp = NULL; result = tybs_stdio_open(memstats, \ if (result == TYBS_R_SUCCESS) { tybs_mem_stats(ns_g_mctx, fp);
天一博胜企业管理软件V1.0 源代码
15
相关推荐:
- [互联网资料]2022年厦门大学机电工程系824机械设计
- [互联网资料]东南大学2022年硕士研究生拟录取名单公
- [互联网资料]能源调研报告(精选多篇)
- [互联网资料]初三英语下学期 中考英语 语法填空训练
- [互联网资料]2022内蒙古选调生行测常识备考:新事物
- [互联网资料]自驾必备!在新西兰租什么样的车自驾游
- [互联网资料]佛教素食菜谱44页未完
- [互联网资料]盈利能力分析外文翻译
- [互联网资料]2022年南昌航空大学音乐学院736马克思
- [互联网资料]优选外贸跟单实习报告总结(精品版)
- [互联网资料]银行新员工培训总结
- [互联网资料]2_year_visa_new_guidance_190316
- [互联网资料]天津市五校宝坻一中静海一中杨村一中芦
- [互联网资料]2007--2008学年第一学期高三数学宁波市
- [互联网资料]Chromatic framework for vision in ba
- [互联网资料]幼儿园大班上学期美术教案《心愿树》含
- [互联网资料]2022年华中农业大学信息学院820微型计
- [互联网资料]硬盘坏道的表现 __硬盘使用久了
- [互联网资料]江苏省2016年会计从业资格考试《会计基
- [互联网资料]公共场所卫生监督试卷全解
- 高级英语第一册所有修辞方法及例子总结
- 综合交通枢纽规划与城市发展
- 沃尔玛的企业文化案例分析
- 美国Thanksgiving Day 感恩节 介绍
- PEP六年级英语上册Unit6How do you fee
- 最齐全的中国大型商场购物中心名单
- 数据结构实验报告八—哈夫曼编译码
- 杭州市余杭区人民政府(通知)
- 七年级语文成语运用专项训练
- 微观经济学第三章 消费者行为 课后习题
- 对_钱学森之问_的思考
- Excel_三级联动_下拉菜单
- 办公用品需求计划申请表
- 对外汉语教材必须要知道的发展史
- 挑战杯大学生学术科技作品竞赛作品申报
- 举办民办教育培训机构应具备下列条件
- 太阳能路灯项目设计方案
- 2013年八年级上最新人教版新教材Unit3I
- 【历史】 6-4 《近代科学之父牛顿》 课
- 高中生物《第四章 第二节 探讨加酶洗衣




