diff options
author | Bruce Momjian <bruce@momjian.us> | 2003-08-04 00:43:34 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2003-08-04 00:43:34 +0000 |
commit | 089003fb462fcce46c02bf47322b429f73c33c50 (patch) | |
tree | 77d78bc3a149df06f5603f60200a6ab363336624 /src/port/copydir.c | |
parent | 63354a0228a1dbc4a0d5ddc8ecdd8326349d2100 (diff) | |
download | postgresql-089003fb462fcce46c02bf47322b429f73c33c50.tar.gz postgresql-089003fb462fcce46c02bf47322b429f73c33c50.zip |
pgindent run.
Diffstat (limited to 'src/port/copydir.c')
-rw-r--r-- | src/port/copydir.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/port/copydir.c b/src/port/copydir.c index 53a819d38df..68959971fd3 100644 --- a/src/port/copydir.c +++ b/src/port/copydir.c @@ -6,13 +6,14 @@ #include "postgres.h" -#undef mkdir /* no reason to use that macro because we ignore the 2nd arg */ +#undef mkdir /* no reason to use that macro because we + * ignore the 2nd arg */ #include <dirent.h> int -copydir(char *fromdir,char *todir) +copydir(char *fromdir, char *todir) { DIR *xldir; struct dirent *xlde; @@ -37,19 +38,19 @@ copydir(char *fromdir,char *todir) while ((xlde = readdir(xldir)) != NULL) { - snprintf(fromfl, MAXPGPATH, "%s/%s", fromdir, xlde->d_name); - snprintf(tofl, MAXPGPATH, "%s/%s", todir, xlde->d_name); - if (CopyFile(fromfl,tofl,TRUE) < 0) - { - int save_errno = errno; - - closedir(xldir); - errno = save_errno; - ereport(ERROR, - (errcode_for_file_access(), - errmsg("could not copy file \"%s\": %m", fromfl))); - return 1; - } + snprintf(fromfl, MAXPGPATH, "%s/%s", fromdir, xlde->d_name); + snprintf(tofl, MAXPGPATH, "%s/%s", todir, xlde->d_name); + if (CopyFile(fromfl, tofl, TRUE) < 0) + { + int save_errno = errno; + + closedir(xldir); + errno = save_errno; + ereport(ERROR, + (errcode_for_file_access(), + errmsg("could not copy file \"%s\": %m", fromfl))); + return 1; + } } closedir(xldir); |