mirror of https://github.com/skeeto/enchive.git
Properly terminate pinentry protocol (BYE)
This isn't strictly necessary on unix-like systems since it will exit when the pipes are closed. Unfortunately Windows isn't so nice and neat and the program will remain open indefinitely even though its inputs and outputs have been closed. So ask pinentry to terminate gracefully.pull/28/head
parent
50624f2373
commit
32d4d99472
|
@ -495,6 +495,9 @@ pinentry(FILE *pfi, FILE *pfo, char *buf, size_t len, char *prompt)
|
|||
pinentry_decode(buf, len, line + 2);
|
||||
else
|
||||
fatal("pinentry protocol failure");
|
||||
|
||||
if (fprintf(pfi, "BYE\n") < 0 || fflush(pfi) < 0)
|
||||
fatal("pinentry write() -- %s", strerror(errno));
|
||||
}
|
||||
|
||||
#if defined(__unix__) || defined(__APPLE__) || defined(__HAIKU__)
|
||||
|
|
Loading…
Reference in New Issue