Don't terminate du(1) if chdir(2) fails

This commit is contained in:
FRIGN 2015-02-18 22:04:32 +01:00
parent 2137dfa334
commit 8c041cd115

4
du.c
View File

@ -51,7 +51,7 @@ push(const char *path)
cwd = agetcwd(); cwd = agetcwd();
if (chdir(path) < 0) if (chdir(path) < 0)
eprintf("chdir: %s:", path); weprintf("chdir: %s:", path);
return cwd; return cwd;
} }
@ -59,7 +59,7 @@ static void
pop(char *path) pop(char *path)
{ {
if (chdir(path) < 0) if (chdir(path) < 0)
eprintf("chdir: %s:", path); weprintf("chdir: %s:", path);
free(path); free(path);
} }