X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=fd.c;h=cc38f1afba150e0de41fff093c0c5b7ccb24e377;hb=15f6e433432a6ba8e021c74b0f28ecd545721d42;hp=112f1835d3e228b9ce9ef9b1c515a067752017ae;hpb=a25f6bb7169f0ea86522a0c613a8ec1dad358103;p=paraslash.git diff --git a/fd.c b/fd.c index 112f1835..cc38f1af 100644 --- a/fd.c +++ b/fd.c @@ -392,22 +392,6 @@ int para_open(const char *path, int flags, mode_t mode) return -ERRNO_TO_PARA_ERROR(errno); } -/** - * Wrapper for chdir(2). - * - * \param path The specified directory. - * - * \return Standard. - */ -int para_chdir(const char *path) -{ - int ret = chdir(path); - - if (ret >= 0) - return 1; - return -ERRNO_TO_PARA_ERROR(errno); -} - /** * Save the cwd and open a given directory. * @@ -443,9 +427,10 @@ static int para_opendir(const char *dirname, DIR **dir, int *cwd) return ret; *cwd = ret; } - ret = para_chdir(dirname); - if (ret < 0) + if (chdir(dirname) != 0) { + ret = -ERRNO_TO_PARA_ERROR(errno); goto close_cwd; + } *dir = opendir("."); if (*dir) return 1;