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;
|
char * s;
|
||||||
int e;
|
int e;
|
||||||
do {
|
do {
|
||||||
|
errno = 0;
|
||||||
s = fgets(tmpstr, CMDLENGTH-(strlen(delim)+1), cmdf);
|
s = fgets(tmpstr, CMDLENGTH-(strlen(delim)+1), cmdf);
|
||||||
e = errno;
|
e = errno;
|
||||||
} while (!s && e == EINTR);
|
} while (!s && e == EINTR);
|
||||||
// this is equivalent but less readable and stuff
|
|
||||||
//while(!fgets(tmpstr, CMDLENGTH-(strlen(delim)+1), cmdf) && errno == EINTR);
|
|
||||||
pclose(cmdf);
|
pclose(cmdf);
|
||||||
int i = strlen(block->icon);
|
int i = strlen(block->icon);
|
||||||
strcpy(output, block->icon);
|
strcpy(output, block->icon);
|
||||||
|
|
Loading…
Reference in a new issue