@@ -134,13 +134,15 @@ sub create_extra_file
134134open (my $fh ,' >' ,$pathname ) ||die " open$pathname :$! " ;
135135print $fh " This is an extra file.\n " ;
136136close ($fh );
137+ return ;
137138}
138139
139140# Add a file into the root directory of the backup.
140141sub mutilate_extra_file
141142{
142143my ($backup_path ) =@_ ;
143144create_extra_file($backup_path ," extra_file" );
145+ return ;
144146}
145147
146148# Add a file inside the user-defined tablespace.
@@ -155,6 +157,7 @@ sub mutilate_extra_tablespace_file
155157 slurp_dir(" $backup_path /pg_tblspc/$tsoid /$catvdir " );
156158create_extra_file($backup_path ,
157159" pg_tblspc/$tsoid /$catvdir /$tsdboid /extra_ts_file" );
160+ return ;
158161}
159162
160163# Remove a file.
@@ -163,6 +166,7 @@ sub mutilate_missing_file
163166my ($backup_path ) =@_ ;
164167my $pathname =" $backup_path /pg_xact/0000" ;
165168unlink ($pathname ) ||die " $pathname :$! " ;
169+ return ;
166170}
167171
168172# Remove the symlink to the user-defined tablespace.
@@ -180,13 +184,15 @@ sub mutilate_missing_tablespace
180184{
181185unlink ($pathname ) ||die " $pathname :$! " ;
182186}
187+ return ;
183188}
184189
185190# Append an additional bytes to a file.
186191sub mutilate_append_to_file
187192{
188193my ($backup_path ) =@_ ;
189194append_to_file" $backup_path /global/pg_control" ,' x' ;
195+ return ;
190196}
191197
192198# Truncate a file to zero length.
@@ -196,6 +202,7 @@ sub mutilate_truncate_file
196202my $pathname =" $backup_path /global/pg_control" ;
197203open (my $fh ,' >' ,$pathname ) ||die " open$pathname :$! " ;
198204close ($fh );
205+ return ;
199206}
200207
201208# Replace a file's contents without changing the length of the file. This is
@@ -209,13 +216,15 @@ sub mutilate_replace_file
209216open (my $fh ,' >' ,$pathname ) ||die " open$pathname :$! " ;
210217print $fh ' q' xlength ($contents );
211218close ($fh );
219+ return ;
212220}
213221
214222# Corrupt the backup manifest.
215223sub mutilate_bad_manifest
216224{
217225my ($backup_path ) =@_ ;
218226append_to_file" $backup_path /backup_manifest" ," \n " ;
227+ return ;
219228}
220229
221230# Create a file that can't be opened. (This is skipped on Windows.)
@@ -224,6 +233,7 @@ sub mutilate_open_file_fails
224233my ($backup_path ) =@_ ;
225234my $pathname =" $backup_path /PG_VERSION" ;
226235chmod (0,$pathname ) ||die " chmod$pathname :$! " ;
236+ return ;
227237}
228238
229239# Create a directory that can't be opened. (This is skipped on Windows.)
@@ -232,6 +242,7 @@ sub mutilate_open_directory_fails
232242my ($backup_path ) =@_ ;
233243my $pathname =" $backup_path /pg_subtrans" ;
234244chmod (0,$pathname ) ||die " chmod$pathname :$! " ;
245+ return ;
235246}
236247
237248# Create a directory that can't be searched. (This is skipped on Windows.)
@@ -240,6 +251,7 @@ sub mutilate_search_directory_fails
240251my ($backup_path ) =@_ ;
241252my $pathname =" $backup_path /base" ;
242253chmod (0400,$pathname ) ||die " chmod$pathname :$! " ;
254+ return ;
243255}
244256
245257# rmtree can't cope with a mode 400 directory, so change back to 700.
@@ -248,4 +260,5 @@ sub cleanup_search_directory_fails
248260my ($backup_path ) =@_ ;
249261my $pathname =" $backup_path /base" ;
250262chmod (0700,$pathname ) ||die " chmod$pathname :$! " ;
263+ return ;
251264}