From 23957c71079683daef81e376dedd212e59d1690d Mon Sep 17 00:00:00 2001 From: Fredrik Salomonsson Date: Fri, 1 May 2020 16:06:55 -0700 Subject: Return ERR instead of exiting when encounter an unknown command (#4) This might help with the high cpu load as gpg seems to be respawning `pinentry-rofi` if it exists when encounter an unknown command. Instead it prints ERR 69 , which is the gpg error code for not implemented. --- pinentry-rofi.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'pinentry-rofi.scm') diff --git a/pinentry-rofi.scm b/pinentry-rofi.scm index 32be279..f7aaf0f 100755 --- a/pinentry-rofi.scm +++ b/pinentry-rofi.scm @@ -195,13 +195,14 @@ touch-file=/run/user/1000/gnupg/S.gpg-agent" ((pinentry-seterror pinentry line)) ((pinentry-bye pinentry line)) (#t (begin - (format #t "BYE\n") (let ((log (pinentry-logfile pinentry))) (when (file-port? log) (format log "Unknown command: ~s\n" line) (force-output log))) + ;; GPG_ERR_NOT_IMPLEMENTED == 69 + (format #t "ERR 69 Unknown command ~s\n" line) (force-output) - (exit #f)))) + (set-pinentry-ok! pinentry #f)))) (when (pinentry-ok pinentry) (format #t "OK\n") (force-output)) -- cgit