reset errno so previous error doesn't cause next check to fail
This commit is contained in:
parent
d474ad1d67
commit
fc80bd975c
1 changed files with 1 additions and 2 deletions
|
@ -97,11 +97,10 @@ void getcmd(const Block *block, char *output)
|
|||
char * s;
|
||||
int e;
|
||||
do {
|
||||
errno = 0;
|
||||
s = fgets(tmpstr, CMDLENGTH-(strlen(delim)+1), cmdf);
|
||||
e = errno;
|
||||
} while (!s && e == EINTR);
|
||||
// this is equivalent but less readable and stuff
|
||||
//while(!fgets(tmpstr, CMDLENGTH-(strlen(delim)+1), cmdf) && errno == EINTR);
|
||||
pclose(cmdf);
|
||||
int i = strlen(block->icon);
|
||||
strcpy(output, block->icon);
|
||||
|
|
Loading…
Reference in a new issue