diff options
author | Michal Nowak newman x <Michal Nowak newman.x@gmail.com> | 2009-06-24 12:12:42 -0400 |
---|---|---|
committer | Michal Nowak newman x <Michal Nowak newman.x@gmail.com> | 2009-06-24 12:12:42 -0400 |
commit | 2afc633e494bbc646c3bdb2be99d6e73ec110ac9 (patch) | |
tree | 82d784f50e8cb235af72fd82737294f99c5a3787 /src/paths.cc | |
parent | 729cad34e5e9d4829fb61e27d8d9e06d0f948053 (diff) |
Check chdir() return code in Paths::init
Diffstat (limited to 'src/paths.cc')
-rw-r--r-- | src/paths.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/paths.cc b/src/paths.cc index 8c5bd20a..9d0abda0 100644 --- a/src/paths.cc +++ b/src/paths.cc @@ -32,10 +32,15 @@ void Paths::init(void) { char *path; struct stat st; + int rc = 0; dFree(oldWorkingDir); oldWorkingDir = dGetcwd(); - chdir("/tmp"); + rc = chdir("/tmp"); + if (rc == -1) { + MSG("paths: error changing directory to /tmp: %s\n", + dStrerror(errno)); + } path = dStrconcat(dGethomedir(), "/.dillo", NULL); if (stat(path, &st) == -1) { |