File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments