Re: [hackers] [slock] Exit as soon as possible on input grabbing error

From: Markus Teich <>
Date: Tue, 30 Aug 2016 18:48:20 +0200


Quentin Rameau wrote:
> We want to know at once if slock failed or not to lock the screen, not seing a
> black screen for a whole second (or two) and then die. Thanks to ^7heo for
> reporting this.

Thanks for the patch. I'd like to apply it with one change:

> + fprintf(stderr, "slock: unable to grab mouse pointer "
> + "for screen %d\n", screen);
> …
> + fprintf(stderr, "slock: unable to grab keyboard "
> + "for screen %d\n", screen);

The error message strings should not be split over different lines, even if they
break the 80 character line length rule. On failure you want to be able to grep
for the exact error string in the source code and

        grep "unable to grab keyboard for screen"

would not work anymore with the string broken into multiple lines.

If there are no objections, I'll apply the amended patch in a few hours.

Received on Tue Aug 30 2016 - 18:48:20 CEST

This archive was generated by hypermail 2.3.0 : Tue Aug 30 2016 - 19:00:16 CEST