Harry Hirsch points out in <https://bugs.edge.launchpad.net/bzr/+bug/297831> that we were relying on a gnu extension (I think) to getcwd, which does not work on SunOS. This avoids it by using fchdir, and also encloses John's previous fix. -- Martin <http://launchpad.net/~mbp/>