Ver código fonte

Check return value of pclose()

master
Laslo Hunhold 6 anos atrás
committed by Aaron Marcher
pai
commit
b640cc489b
1 arquivos alterados com 4 adições e 1 exclusões
  1. +4
    -1
      components/run_command.c

+ 4
- 1
components/run_command.c Ver arquivo

@@ -16,7 +16,10 @@ run_command(const char *cmd)
return NULL;
}
p = fgets(buf, sizeof(buf) - 1, fp);
pclose(fp);
if (pclose(fp) < 0) {
warn("pclose '%s':", cmd);
return NULL;
}
if (!p) {
return NULL;
}


Carregando…
Cancelar
Salvar