示例#1
0
/**
 * Print a character to syslog console
 *
 * @v character		Character to be printed
 */
static void syslog_putchar ( int character ) {
	int rc;

	/* Ignore if we are already mid-logging */
	if ( syslog_entered )
		return;

	/* Fill line buffer */
	if ( line_putchar ( &syslog_line, character ) == 0 )
		return;

	/* Guard against re-entry */
	syslog_entered = 1;

	/* Send log message */
	if ( ( rc = xfer_printf ( &syslogger, "<%d>ipxe: %s",
				  SYSLOG_PRIORITY ( SYSLOG_FACILITY,
						    SYSLOG_SEVERITY ),
				  syslog_buffer ) ) != 0 ) {
		DBG ( "SYSLOG could not send log message: %s\n",
		      strerror ( rc ) );
	}

	/* Clear re-entry flag */
	syslog_entered = 0;
}
示例#2
0
/**
 * Print a character to VMware logfile console
 *
 * @v character		Character to be printed
 */
static void vmconsole_putchar ( int character ) {
	int rc;

	/* Ignore if we are already mid-logging */
	if ( vmconsole_entered )
		return;

	/* Fill line buffer */
	if ( line_putchar ( &vmconsole_line, character ) == 0 )
		return;

	/* Guard against re-entry */
	vmconsole_entered = 1;

	/* Send log message */
	if ( ( rc = guestrpc_command ( vmconsole_channel,
				       vmconsole_buffer.prefix, NULL, 0 ) ) <0){
		DBG ( "VMware console could not send log message: %s\n",
		      strerror ( rc ) );
	}

	/* Clear re-entry flag */
	vmconsole_entered = 0;
}