@@ -57,27 +57,27 @@ copydir(char *fromdir, char *todir, bool recurse)
5757
5858cfs_control_gc_lock ();/* disable GC during copy */
5959
60- PG_ENSURE_ERROR_CLEANUP (cfs_control_gc_unlock , (Datum )NULL );
60+ PG_ENSURE_ERROR_CLEANUP (cfs_on_exit_callback , (Datum )NULL );
6161{
6262while ((xlde = ReadDir (xldir ,fromdir ))!= NULL )
6363{
6464struct stat fst ;
65-
65+
6666/* If we got a cancel signal during the copy of the directory, quit */
6767CHECK_FOR_INTERRUPTS ();
68-
68+
6969if (strcmp (xlde -> d_name ,"." )== 0 ||
7070strcmp (xlde -> d_name ,".." )== 0 )
7171continue ;
72-
72+
7373snprintf (fromfile ,MAXPGPATH ,"%s/%s" ,fromdir ,xlde -> d_name );
7474snprintf (tofile ,MAXPGPATH ,"%s/%s" ,todir ,xlde -> d_name );
75-
75+
7676if (lstat (fromfile ,& fst )< 0 )
7777ereport (ERROR ,
7878(errcode_for_file_access (),
7979errmsg ("could not stat file \"%s\": %m" ,fromfile )));
80-
80+
8181if (S_ISDIR (fst .st_mode ))
8282{
8383/* recurse to handle subdirectories */
@@ -89,9 +89,9 @@ copydir(char *fromdir, char *todir, bool recurse)
8989}
9090FreeDir (xldir );
9191}
92- PG_END_ENSURE_ERROR_CLEANUP (cfs_control_gc_unlock , (Datum )NULL );
92+ PG_END_ENSURE_ERROR_CLEANUP (cfs_on_exit_callback , (Datum )NULL );
9393cfs_control_gc_unlock ();
94-
94+
9595/*
9696 * Be paranoid here and fsync all files to ensure the copy is really done.
9797 * But if fsync is disabled, we're done.
@@ -164,35 +164,35 @@ copyzipdir(char *fromdir, bool from_compressed,
164164
165165cfs_control_gc_lock ();/* disable GC during copy */
166166
167- PG_ENSURE_ERROR_CLEANUP (cfs_control_gc_unlock , (Datum )NULL );
167+ PG_ENSURE_ERROR_CLEANUP (cfs_on_exit_callback , (Datum )NULL );
168168{
169169while ((xlde = ReadDir (xldir ,fromdir ))!= NULL )
170170{
171171struct stat fst ;
172-
172+
173173/* If we got a cancel signal during the copy of the directory, quit */
174174CHECK_FOR_INTERRUPTS ();
175-
175+
176176if (strcmp (xlde -> d_name ,"." )== 0
177177|| strcmp (xlde -> d_name ,".." )== 0
178178|| (strlen (xlde -> d_name )> 4
179179&& strcmp (xlde -> d_name + strlen (xlde -> d_name )- 4 ,".cfm" )== 0 ))
180180continue ;
181-
181+
182182snprintf (fromfile ,MAXPGPATH ,"%s/%s" ,fromdir ,xlde -> d_name );
183183snprintf (tofile ,MAXPGPATH ,"%s/%s" ,todir ,xlde -> d_name );
184-
184+
185185if (lstat (fromfile ,& fst )< 0 )
186186ereport (ERROR ,
187187(errcode_for_file_access (),
188188errmsg ("could not stat file \"%s\": %m" ,fromfile )));
189-
189+
190190if (S_ISREG (fst .st_mode ))
191191copy_zip_file (fromfile ,from_compressed ,tofile ,to_compressed );
192192}
193193FreeDir (xldir );
194194}
195- PG_END_ENSURE_ERROR_CLEANUP (cfs_control_gc_unlock , (Datum )NULL );
195+ PG_END_ENSURE_ERROR_CLEANUP (cfs_on_exit_callback , (Datum )NULL );
196196cfs_control_gc_unlock ();
197197
198198/*