New internal function for SCSI-logging arbitrary texts

This commit is contained in:
Thomas Schmitt 2014-07-31 11:59:23 +00:00
parent a4ddd4a22e
commit d37d0e6e9b
3 changed files with 23 additions and 1 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2014.07.14.180122"
#define Cdrskin_timestamP "2014.07.31.115829"

View File

@ -1709,6 +1709,24 @@ int scsi_log_command(unsigned char *opcode, int oplen, int data_dir,
}
/* ts B40731 */
/* Arbitrary SCSI log message */
int scsi_log_text(char *text, void *fp_in, int flag)
{
FILE *fp = fp_in;
if (fp != NULL && (fp == stderr || (burn_sg_log_scsi & 1))) {
fprintf(fp, "%s\n", text);
if (burn_sg_log_scsi & 4)
fflush(fp);
}
if (fp == stderr || !(burn_sg_log_scsi & 2))
return 1;
fprintf(stderr, "%s\n", text);
return 1;
}
/* ts A91218 (former sg_log_cmd ts A70518) */
/** Logs command (before execution) */
int scsi_log_cmd(struct command *c, void *fp_in, int flag)

View File

@ -76,6 +76,10 @@ int scsi_log_command(unsigned char *opcode, int oplen, int data_dir,
unsigned char *data, int bytes,
void *fp_in, int flag);
/* ts B40731 */
/* Arbitrary SCSI log message */
int scsi_log_text(char *text, void *fp_in, int flag);
/* ts A91218 (former sg_log_cmd ts A70518) */
/** Legacy frontend to scsi_log_command() */
int scsi_log_cmd(struct command *c, void *fp, int flag);