]> arthur.barton.de Git - netatalk.git/commitdiff
volinfo: test chdir return value
authordidg <didg>
Tue, 2 Dec 2008 02:17:43 +0000 (02:17 +0000)
committerdidg <didg>
Tue, 2 Dec 2008 02:17:43 +0000 (02:17 +0000)
libatalk/util/volinfo.c

index ac1e61d0c175c338f6785beb00981a1479e572f0..646438b3cb770048aef567c9bc64d2147f55a7ed 100644 (file)
@@ -152,13 +152,13 @@ static char * make_path_absolute(char *path, size_t bufsize)
         *p = '\0';
     }
 
-    getcwd(savecwd, sizeof(savecwd));
-    if ((chdir(abspath)) < 0)  
+    if (!getcwd(savecwd, sizeof(savecwd)) || chdir(abspath) < 0)       
         return NULL;
 
-    getcwd(abspath, sizeof(abspath));
-    chdir (savecwd);
-
+    if (!getcwd(abspath, sizeof(abspath)) || chdir (savecwd) < 0)
+        return NULL;
+        
+    
     if (strlen(abspath) > bufsize)
         return NULL;