@@ -40,25 +40,25 @@ cloneFile(const char *src, const char *dst,
40
40
{
41
41
#if defined(HAVE_COPYFILE ) && defined(COPYFILE_CLONE_FORCE )
42
42
if (copyfile (src , dst , NULL , COPYFILE_CLONE_FORCE ) < 0 )
43
- pg_fatal ("error while cloning relation \"%s.%s\" (\"%s\" to \"%s\"): %s\n " ,
43
+ pg_fatal ("error while cloning relation \"%s.%s\" (\"%s\" to \"%s\"): %s" ,
44
44
schemaName , relName , src , dst , strerror (errno ));
45
45
#elif defined(__linux__ ) && defined(FICLONE )
46
46
int src_fd ;
47
47
int dest_fd ;
48
48
49
49
if ((src_fd = open (src , O_RDONLY | PG_BINARY , 0 )) < 0 )
50
- pg_fatal ("error while cloning relation \"%s.%s\": could not open file \"%s\": %s\n " ,
50
+ pg_fatal ("error while cloning relation \"%s.%s\": could not open file \"%s\": %s" ,
51
51
schemaName , relName , src , strerror (errno ));
52
52
53
53
if ((dest_fd = open (dst , O_RDWR | O_CREAT | O_EXCL | PG_BINARY ,
54
54
pg_file_create_mode )) < 0 )
55
- pg_fatal ("error while cloning relation \"%s.%s\": could not create file \"%s\": %s\n " ,
55
+ pg_fatal ("error while cloning relation \"%s.%s\": could not create file \"%s\": %s" ,
56
56
schemaName , relName , dst , strerror (errno ));
57
57
58
58
if (ioctl (dest_fd , FICLONE , src_fd ) < 0 )
59
59
{
60
60
unlink (dst );
61
- pg_fatal ("error while cloning relation \"%s.%s\" (\"%s\" to \"%s\"): %s\n " ,
61
+ pg_fatal ("error while cloning relation \"%s.%s\" (\"%s\" to \"%s\"): %s" ,
62
62
schemaName , relName , src , dst , strerror (errno ));
63
63
}
64
64
@@ -84,12 +84,12 @@ copyFile(const char *src, const char *dst,
84
84
char * buffer ;
85
85
86
86
if ((src_fd = open (src , O_RDONLY | PG_BINARY , 0 )) < 0 )
87
- pg_fatal ("error while copying relation \"%s.%s\": could not open file \"%s\": %s\n " ,
87
+ pg_fatal ("error while copying relation \"%s.%s\": could not open file \"%s\": %s" ,
88
88
schemaName , relName , src , strerror (errno ));
89
89
90
90
if ((dest_fd = open (dst , O_RDWR | O_CREAT | O_EXCL | PG_BINARY ,
91
91
pg_file_create_mode )) < 0 )
92
- pg_fatal ("error while copying relation \"%s.%s\": could not create file \"%s\": %s\n " ,
92
+ pg_fatal ("error while copying relation \"%s.%s\": could not create file \"%s\": %s" ,
93
93
schemaName , relName , dst , strerror (errno ));
94
94
95
95
/* copy in fairly large chunks for best efficiency */
@@ -103,7 +103,7 @@ copyFile(const char *src, const char *dst,
103
103
ssize_t nbytes = read (src_fd , buffer , COPY_BUF_SIZE );
104
104
105
105
if (nbytes < 0 )
106
- pg_fatal ("error while copying relation \"%s.%s\": could not read file \"%s\": %s\n " ,
106
+ pg_fatal ("error while copying relation \"%s.%s\": could not read file \"%s\": %s" ,
107
107
schemaName , relName , src , strerror (errno ));
108
108
109
109
if (nbytes == 0 )
@@ -115,7 +115,7 @@ copyFile(const char *src, const char *dst,
115
115
/* if write didn't set errno, assume problem is no disk space */
116
116
if (errno == 0 )
117
117
errno = ENOSPC ;
118
- pg_fatal ("error while copying relation \"%s.%s\": could not write file \"%s\": %s\n " ,
118
+ pg_fatal ("error while copying relation \"%s.%s\": could not write file \"%s\": %s" ,
119
119
schemaName , relName , dst , strerror (errno ));
120
120
}
121
121
}
@@ -129,7 +129,7 @@ copyFile(const char *src, const char *dst,
129
129
if (CopyFile (src , dst , true) == 0 )
130
130
{
131
131
_dosmaperr (GetLastError ());
132
- pg_fatal ("error while copying relation \"%s.%s\" (\"%s\" to \"%s\"): %s\n " ,
132
+ pg_fatal ("error while copying relation \"%s.%s\" (\"%s\" to \"%s\"): %s" ,
133
133
schemaName , relName , src , dst , strerror (errno ));
134
134
}
135
135
@@ -148,7 +148,7 @@ linkFile(const char *src, const char *dst,
148
148
const char * schemaName , const char * relName )
149
149
{
150
150
if (link (src , dst ) < 0 )
151
- pg_fatal ("error while creating link for relation \"%s.%s\" (\"%s\" to \"%s\"): %s\n " ,
151
+ pg_fatal ("error while creating link for relation \"%s.%s\" (\"%s\" to \"%s\"): %s" ,
152
152
schemaName , relName , src , dst , strerror (errno ));
153
153
}
154
154
@@ -187,16 +187,16 @@ rewriteVisibilityMap(const char *fromfile, const char *tofile,
187
187
rewriteVmBytesPerPage = (BLCKSZ - SizeOfPageHeaderData ) / 2 ;
188
188
189
189
if ((src_fd = open (fromfile , O_RDONLY | PG_BINARY , 0 )) < 0 )
190
- pg_fatal ("error while copying relation \"%s.%s\": could not open file \"%s\": %s\n " ,
190
+ pg_fatal ("error while copying relation \"%s.%s\": could not open file \"%s\": %s" ,
191
191
schemaName , relName , fromfile , strerror (errno ));
192
192
193
193
if (fstat (src_fd , & statbuf ) != 0 )
194
- pg_fatal ("error while copying relation \"%s.%s\": could not stat file \"%s\": %s\n " ,
194
+ pg_fatal ("error while copying relation \"%s.%s\": could not stat file \"%s\": %s" ,
195
195
schemaName , relName , fromfile , strerror (errno ));
196
196
197
197
if ((dst_fd = open (tofile , O_RDWR | O_CREAT | O_EXCL | PG_BINARY ,
198
198
pg_file_create_mode )) < 0 )
199
- pg_fatal ("error while copying relation \"%s.%s\": could not create file \"%s\": %s\n " ,
199
+ pg_fatal ("error while copying relation \"%s.%s\": could not create file \"%s\": %s" ,
200
200
schemaName , relName , tofile , strerror (errno ));
201
201
202
202
/* Save old file size */
@@ -220,10 +220,10 @@ rewriteVisibilityMap(const char *fromfile, const char *tofile,
220
220
if ((bytesRead = read (src_fd , buffer .data , BLCKSZ )) != BLCKSZ )
221
221
{
222
222
if (bytesRead < 0 )
223
- pg_fatal ("error while copying relation \"%s.%s\": could not read file \"%s\": %s\n " ,
223
+ pg_fatal ("error while copying relation \"%s.%s\": could not read file \"%s\": %s" ,
224
224
schemaName , relName , fromfile , strerror (errno ));
225
225
else
226
- pg_fatal ("error while copying relation \"%s.%s\": partial page found in file \"%s\"\n " ,
226
+ pg_fatal ("error while copying relation \"%s.%s\": partial page found in file \"%s\"" ,
227
227
schemaName , relName , fromfile );
228
228
}
229
229
@@ -298,7 +298,7 @@ rewriteVisibilityMap(const char *fromfile, const char *tofile,
298
298
/* if write didn't set errno, assume problem is no disk space */
299
299
if (errno == 0 )
300
300
errno = ENOSPC ;
301
- pg_fatal ("error while copying relation \"%s.%s\": could not write file \"%s\": %s\n " ,
301
+ pg_fatal ("error while copying relation \"%s.%s\": could not write file \"%s\": %s" ,
302
302
schemaName , relName , tofile , strerror (errno ));
303
303
}
304
304
@@ -325,31 +325,31 @@ check_file_clone(void)
325
325
326
326
#if defined(HAVE_COPYFILE ) && defined(COPYFILE_CLONE_FORCE )
327
327
if (copyfile (existing_file , new_link_file , NULL , COPYFILE_CLONE_FORCE ) < 0 )
328
- pg_fatal ("could not clone file between old and new data directories: %s\n " ,
328
+ pg_fatal ("could not clone file between old and new data directories: %s" ,
329
329
strerror (errno ));
330
330
#elif defined(__linux__ ) && defined(FICLONE )
331
331
{
332
332
int src_fd ;
333
333
int dest_fd ;
334
334
335
335
if ((src_fd = open (existing_file , O_RDONLY | PG_BINARY , 0 )) < 0 )
336
- pg_fatal ("could not open file \"%s\": %s\n " ,
336
+ pg_fatal ("could not open file \"%s\": %s" ,
337
337
existing_file , strerror (errno ));
338
338
339
339
if ((dest_fd = open (new_link_file , O_RDWR | O_CREAT | O_EXCL | PG_BINARY ,
340
340
pg_file_create_mode )) < 0 )
341
- pg_fatal ("could not create file \"%s\": %s\n " ,
341
+ pg_fatal ("could not create file \"%s\": %s" ,
342
342
new_link_file , strerror (errno ));
343
343
344
344
if (ioctl (dest_fd , FICLONE , src_fd ) < 0 )
345
- pg_fatal ("could not clone file between old and new data directories: %s\n " ,
345
+ pg_fatal ("could not clone file between old and new data directories: %s" ,
346
346
strerror (errno ));
347
347
348
348
close (src_fd );
349
349
close (dest_fd );
350
350
}
351
351
#else
352
- pg_fatal ("file cloning not supported on this platform\n " );
352
+ pg_fatal ("file cloning not supported on this platform" );
353
353
#endif
354
354
355
355
unlink (new_link_file );
@@ -367,7 +367,7 @@ check_hard_link(void)
367
367
368
368
if (link (existing_file , new_link_file ) < 0 )
369
369
pg_fatal ("could not create hard link between old and new data directories: %s\n"
370
- "In link mode the old and new data directories must be on the same file system.\n " ,
370
+ "In link mode the old and new data directories must be on the same file system." ,
371
371
strerror (errno ));
372
372
373
373
unlink (new_link_file );
0 commit comments