diff options
author | Jim Meyering <jim@meyering.net> | 1995-02-23 21:12:11 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1995-02-23 21:12:11 +0000 |
commit | aeebbd038cba80ae8d58fbfccfcdf3fa79782d13 (patch) | |
tree | 97e841f11f9d4f9b4b64901746c5bd8ff1e870fc /src | |
parent | 875eafd4895baf158e376508b84832e6c047b6a8 (diff) | |
download | coreutils-aeebbd038cba80ae8d58fbfccfcdf3fa79782d13.tar.xz |
(save_cwd) [!HAVE_FCHDIR]: Avoid a core dump via abort() which occurred
because cwd->desc was uninitialed.
(restore_cwd) [!HAVE_FCHDIR]: Remove unnecessary redefinition of fchdir.
Both from Bruno Haible.
Diffstat (limited to 'src')
-rw-r--r-- | src/du.c | 6 |
1 files changed, 1 insertions, 5 deletions
@@ -225,6 +225,7 @@ save_cwd (cwd) if (!have_working_fchdir) { + cwd->desc = -1; cwd->name = xgetcwd (); if (cwd->name == NULL) error (1, errno, "cannot get current directory"); @@ -241,11 +242,6 @@ restore_cwd (cwd, dest, current) const char *dest; const char *current; { - -#ifndef HAVE_FCHDIR -#define fchdir(x) (abort (), -1) -#endif - if (cwd->desc >= 0) { if (fchdir (cwd->desc) < 0) |