这篇教程C++ upslogx函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中upslogx函数的典型用法代码示例。如果您正苦于以下问题:C++ upslogx函数的具体用法?C++ upslogx怎么用?C++ upslogx使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了upslogx函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: doshutdown/* the actual shutdown procedure */static void doshutdown(void){ int ret; /* this should probably go away at some point */ upslogx(LOG_CRIT, "Executing automatic power-fail shutdown"); wall("Executing automatic power-fail shutdown/n"); do_notify(NULL, NOTIFY_SHUTDOWN); sleep(finaldelay); /* in the pipe model, we let the parent do this for us */ if (use_pipe) { char ch; ch = 1; ret = write(pipefd[1], &ch, 1); } else { /* one process model = we do all the work here */ if (geteuid() != 0) upslogx(LOG_WARNING, "Not root, shutdown may fail"); set_pdflag(); ret = system(shutdowncmd); if (ret != 0) upslogx(LOG_ERR, "Unable to call shutdown command: %s", shutdowncmd); } exit(EXIT_SUCCESS);}
开发者ID:ThomasKurz,项目名称:nut,代码行数:36,
|