[Xquartz-dev] My hack for reading .Xmodmap
Cameron Simpson
cs at zip.com.au
Tue Nov 3 19:05:08 PST 2009
On 03Nov2009 16:48, Jeremy Huddleston <jeremyhu at apple.com> wrote:
| Here's the change I went with based on your original patch:
| http://cgit.freedesktop.org/~jeremyhu/xserver/commit/?id=5e79976c13c5b94b12392b493846ca26be11750b
|
| comments on yours:
| 1) hardcoded 1024... use PATH_MAX instead.
| 2) You only used ~/.Xmodmap if you also had a system one.
[...]
| > + /* Check for system .Xmodmap */
| > + if (access(sysmodmap, F_OK) == 0) {
| > + snprintf (cmd, sizeof(cmd), "exec %s %s &", xmodmap, sysmodmap);
| > + System(cmd);
[...]
Isn't there a decent performance/resouce gain from a direct fork/exec
rather than System() (which goes fork, exec-/bin/sh, then /bin/sh forks
and then execs xmodmap because of the "&). And it would be prudent to
close stdin in the child, too.
Cheers,
--
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/
UNIX was not designed to stop you from doing stupid things, because that
would also stop you from doing clever things. - Doug Gwyn
More information about the Xquartz-dev
mailing list