예제 #1
0
void start_log_and_pid(const char *client_server, const char *pidfile)
{
	int pid_fd;
#if !defined(TCSUPPORT_CT) 
#ifdef TCSUPPORT_SYSLOG_ENHANCE
	char buf[32];

	memset(buf, 0, sizeof(buf));
	sprintf(buf, "TCSysLog %s", client_server);
#endif
#endif

	/* Make sure our syslog fd isn't overwritten */
	sanitize_fds();

	/* do some other misc startup stuff while we are here to save bytes */
	pid_fd = pidfile_acquire(pidfile);
	pidfile_write_release(pid_fd);

	/* equivelent of doing a fflush after every \n */
	setlinebuf(stdout);
#if !defined(TCSUPPORT_CT) 
#if !defined(TCSUPPORT_C1_SYSLOG) 
#ifdef TCSUPPORT_SYSLOG_ENHANCE
	openlog(buf, LOG_PID | LOG_CONS, LOG_LOCAL0);
#else
	openlog(client_server, LOG_PID | LOG_CONS, LOG_LOCAL0);
#endif
#endif
#endif
	udhcp_logging(LOG_INFO, "%s (v%s) started", client_server, VERSION);
}
예제 #2
0
void start_log_and_pid(const char *client_server, const char *pidfile)
{
	int pid_fd;

	/* Make sure our syslog fd isn't overwritten */
	sanitize_fds();

	/* do some other misc startup stuff while we are here to save bytes */
	pid_fd = pidfile_acquire(pidfile);
	pidfile_write_release(pid_fd);

	/* equivelent of doing a fflush after every \n */
	setlinebuf(stdout);

	udhcp_logging(LOG_INFO, "%s (v%s) started", client_server, VERSION);
}
예제 #3
0
void udhcp_start_log_and_pid(const char *client_server, const char *pidfile)
{
	int pid_fd;

	/* Make sure our syslog fd isn't overwritten */
	sanitize_fds();

	/* do some other misc startup stuff while we are here to save bytes */
	pid_fd = pidfile_acquire(pidfile);
	pidfile_write_release(pid_fd);

	/* equivelent of doing a fflush after every \n */
	setlinebuf(stdout);

	if (ENABLE_FEATURE_UDHCP_SYSLOG)
		openlog(client_server, LOG_PID | LOG_CONS, LOG_LOCAL0);

	udhcp_logging(LOG_INFO, "%s (v%s) started", client_server, BB_VER);
}