On 03Nov2009 16:48, Jeremy Huddleston <jeremyhu@apple.com> wrote: | Here's the change I went with based on your original patch: | http://cgit.freedesktop.org/~jeremyhu/xserver/commit/?id=5e79976c13c5b94b123... | | 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@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