mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 01:29:05 -04:00
ncneofetch: popen(3) wants pclose(3), not fclose(3)
This commit is contained in:
parent
7df761c041
commit
ec5ba6da80
@ -156,12 +156,12 @@ pipe_getline(const char* cmdline){
|
||||
char* buf = malloc(BUFSIZ); // gatesv("BUFSIZ bytes is enough for anyone")
|
||||
if(fgets(buf, BUFSIZ, p) == NULL){
|
||||
//fprintf(stderr, "Error reading from %s (%s)\n", cmdline, strerror(errno));
|
||||
fclose(p);
|
||||
pclose(p);
|
||||
free(buf);
|
||||
return NULL;
|
||||
}
|
||||
// FIXME read any remaining junk so as to stave off SIGPIPEs?
|
||||
if(fclose(p)){
|
||||
if(pclose(p)){
|
||||
fprintf(stderr, "Error closing pipe (%s)\n", strerror(errno));
|
||||
free(buf);
|
||||
return NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user