Following my own suggestion (second comment on the question), here's an answer which avoids the prompting altogether:
(require 'auto-answer)
(let ((auto-answer '(("\\`Active processes exist; kill them and exit anyway\\? \\'" t))))
(save-buffers-kill-emacs))
This uses auto-answer.el
, available at https://github.com/YoungFrog/auto-answer/blob/master/auto-answer.el (it requires dash.el from your favourite package store, and nadvice.el which is available at least in 24.4).
Edit:
If you only want to avoid the prompt for some (specific) processes, the documented way to do it is to set its query-on-exit flag to nil
using set-process-query-on-exit-flag
when creating the process.