reset errno so previous error doesn't cause next check to fail

This commit is contained in:
dfuehrer 2021-03-23 18:29:19 -07:00
parent d474ad1d67
commit fc80bd975c

View file

@ -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);