Skip to content

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-jonsson committed Jan 10, 2024
1 parent 259c7f0 commit afece7c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions modules/rifs/rifs.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ static void server_response(struct rifs *fs, const struct rifs_packet *pk, int p
static bool verify_packet(struct rifs_packet *pk) {
vxt_word len = ~pk->notlength;
if (pk->length != len) {
fprintf(stderr, "RIFS packet of invalid size!\n");
VXT_LOG("ERROR: Packet of invalid size!");
return false;
}

vxt_dword crc = pk->crc32;
pk->crc32 = 0;

if (crc != crc32((vxt_byte*)pk, len)) {
fprintf(stderr, "RIFS packet CRC failed!\n");
VXT_LOG("ERROR: Packet CRC failed!");
return false;
}

Expand All @@ -168,7 +168,7 @@ static const char *host_path(struct rifs *fs, const char *path) {
if ((strlen(path) >= 2) && (path[1] == ':'))
path = path + 2;
else
fprintf(stderr, "RIFS path is not absolute!\n");
VXT_LOG("WARNING: Path is not absolute!");

strncat(fs->path_scratchpad, path, sizeof(fs->path_scratchpad) - 1);

Expand Down Expand Up @@ -202,7 +202,7 @@ static void process_request(struct rifs *fs, struct rifs_packet *pk) {
int data_size = pk->length - sizeof(struct rifs_packet);
struct dos_proc *proc = get_proc(fs, pk->process_id);
if (!proc) {
fprintf(stderr, "To many RIFS procs!\n");
VXT_LOG("ERROR: To many RIFS procs!");
return;
}

Expand Down Expand Up @@ -402,7 +402,7 @@ static void process_request(struct rifs *fs, struct rifs_packet *pk) {
server_response(fs, pk, 0);
break;
default:
fprintf(stderr, "Unknown RIFS command: 0x%X (payload size %d)\n", pk->cmd, data_size);
VXT_LOG("WARNING: Unknown RIFS command: 0x%X (payload size %d)", pk->cmd, data_size);
pk->cmd = 0x16; // Unknown command
server_response(fs, pk, 0);
}
Expand Down Expand Up @@ -445,7 +445,7 @@ static void out(struct rifs *fs, vxt_word port, vxt_byte data) {
return;

if (fs->buffer_output_len >= BUFFER_SIZE) {
fprintf(stderr, "Invalid RIFS buffer state!\n");
VXT_LOG("ERROR: Invalid RIFS buffer state!");
fs->buffer_output_len = 0;
return;
}
Expand All @@ -466,7 +466,7 @@ static void out(struct rifs *fs, vxt_word port, vxt_byte data) {
if (fs->dlab != dlab) {
fs->dlab = dlab;
fs->buffer_output_len = fs->buffer_input_len = 0;
fprintf(stderr, "DLAB change! Assume RIFS state reset.\n");
VXT_LOG("DLAB change! Assume RIFS state reset.");
}
}
break;
Expand Down

0 comments on commit afece7c

Please sign in to comment.