about summary refs log tree commit diff
path: root/Src/utils.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2009-03-15 01:04:50 +0000
committerWayne Davison <wayned@users.sourceforge.net>2009-03-15 01:04:50 +0000
commitbf25c3a43f79f568b55c45e2701f5c961977b47c (patch)
treeeacd272cd739c11b793aa5788bba21fdc6d1205e /Src/utils.c
parentf0bcd0ecd0896180c5a3f977e086f7237a774d25 (diff)
downloadzsh-bf25c3a43f79f568b55c45e2701f5c961977b47c.tar.gz
zsh-bf25c3a43f79f568b55c45e2701f5c961977b47c.tar.xz
zsh-bf25c3a43f79f568b55c45e2701f5c961977b47c.zip
26735: Check some function return values for failures. Gets rid of
some compiler warnings, and improves error handling/notification.
Diffstat (limited to 'Src/utils.c')
-rw-r--r--Src/utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/utils.c b/Src/utils.c
index 7a983d48d..340ceb857 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -5422,7 +5422,8 @@ lchdir(char const *path, struct dirsav *d, int hard)
     }
 #ifdef HAVE_LSTAT
     if (*path == '/')
-	chdir("/");
+	if (chdir("/") < 0)
+	    zwarn("failed to chdir(/): %e", errno);
     for(;;) {
 	while(*path == '/')
 	    path++;