+(defun epg-process-sentinel (process status)
+ (if (and (buffer-live-p (process-buffer process))
+ (not (equal status "finished\n")))
+ (save-excursion
+ (set-buffer (process-buffer process))
+ ;; gpg process exited abnormally, but we have not received an
+ ;; error response from it. Set it here.
+ (unless (epg-context-result-for epg-context 'error)
+ (if (string-match "\\`exited abnormally with code \\(.*\\)\n" status)
+ (epg-context-set-result-for
+ epg-context 'error
+ (list (cons 'exit (string-to-number (match-string 1 status)))))
+ (epg-context-set-result-for epg-context 'error
+ (list (cons 'signal status))))))))
+