Skip to content

Commit aa9c995

Browse files
committed
fix: correct the comment
1 parent d02ab52 commit aa9c995

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cprintf.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,11 +396,15 @@ static char *get_bg_color__(void)
396396
// Set a timeout of 0.1 second.
397397
struct itimerval timer;
398398
timer.it_value.tv_sec = 0;
399-
timer.it_value.tv_usec = 200000; // 0.1 second
399+
// Timeout of 0.2 second.
400+
// And we will wait for the response for 0.1 second.
401+
// So the real timeout is 0.1 second.
402+
timer.it_value.tv_usec = 200000;
400403
timer.it_interval.tv_sec = 0;
401404
timer.it_interval.tv_usec = 0;
402405
setitimer(ITIMER_REAL, &timer, NULL);
403-
usleep(100000); // Sleep for 0.1 second to wait for the response.
406+
// Sleep for 0.1 second to wait for the response.
407+
usleep(100000);
404408
int n = read(STDERR_FILENO, buf, sizeof(buf) - 1);
405409
if (n < 0) {
406410
// If read failed, we will return NULL.

0 commit comments

Comments
 (0)