kfish/xsel — pull request #5 by zevweiss (2014-09-03 09:08:41+00:00)
Title: Fixes and new functionality for '-t'; also a small build fix

Hi,

This branch includes a few small things:
- first, a build fix -- xsel wasn't compiling for me (on Debian jessie) due to not getting `-lX11` passed to the link command
- second, some fixes to `setitimer(2)` usage -- depending on the timeout value it could fail with `EINVAL`, and using virtual time instead of real time was, I think, not what was really intended
- finally, a new feature: in `--input` mode, the `-t` flag now specifies a duration after which the daemon exits. This is useful for an "ephemeral" copy operation (e.g. of a password you don't want hanging around in your clipboard unnecessarily).

Note that I am completely unfamiliar with X11 programming, so I hope i haven't done anything horribly wrong in the third patch -- for example, if the timer expires and delivers `SIGALRM` while the daemon's in the middle of doing some selection operation, will that leave things in a weird state? (Hopefully not, but I don't know.) Basic testing indicates that it does what I was aiming for, though.

Thanks,
Zev Weiss