smarter --gestaltid

This commit is contained in:
Laurent Vivier 2005-09-10 00:06:08 +00:00
parent b5c3418abf
commit 8efc25ca70
2 changed files with 4 additions and 5 deletions

View File

@ -59,7 +59,8 @@ int emile_second_set_output(int fd, unsigned int enable_mask,
if (parity1 != -1) if (parity1 != -1)
header.serial1_parity = parity1; header.serial1_parity = parity1;
header.gestaltID = gestaltid; /* 0 means unset ... */ if (gestaltid != -1)
header.gestaltID = gestaltid; /* 0 means unset ... */
ret = lseek(fd, location, SEEK_SET); ret = lseek(fd, location, SEEK_SET);
if (ret == -1) if (ret == -1)

View File

@ -211,14 +211,13 @@ int main(int argc, char** argv)
int c; int c;
unsigned int enable_mask = 0; unsigned int enable_mask = 0;
unsigned int disable_mask = 0; unsigned int disable_mask = 0;
unsigned int setgestaltid = 0;
unsigned int last = 0; unsigned int last = 0;
int width = 0, height = 0 , depth = 0; int width = 0, height = 0 , depth = 0;
unsigned int bitrate0 = 0, bitrate1 = 0; unsigned int bitrate0 = 0, bitrate1 = 0;
int datasize0 = -1, datasize1 = -1; int datasize0 = -1, datasize1 = -1;
int stopbits0 = -1, stopbits1 = -1; int stopbits0 = -1, stopbits1 = -1;
int parity0 = -1, parity1 = -1; int parity0 = -1, parity1 = -1;
int gestaltid = 0; int gestaltid = -1;
while(1) while(1)
{ {
@ -234,7 +233,6 @@ int main(int argc, char** argv)
return 0; return 0;
case ARG_GESTALTID: case ARG_GESTALTID:
gestaltid = atol(optarg); gestaltid = atol(optarg);
setgestaltid = 1;
break; break;
case ARG_NODISPLAY: case ARG_NODISPLAY:
disable_mask |= STDOUT_VGA; disable_mask |= STDOUT_VGA;
@ -352,7 +350,7 @@ int main(int argc, char** argv)
fprintf(stderr, "Cannot enable and disable at same time\n"); fprintf(stderr, "Cannot enable and disable at same time\n");
return 2; return 2;
} }
if ( (enable_mask == 0) && (disable_mask == 0) && !setgestaltid) if ( (enable_mask == 0) && (disable_mask == 0) && (gestaltid == -1))
{ {
display_output(image); display_output(image);
return 0; return 0;