Skip to content

Commit 230cf8d

Browse files
committed
Check for link(2) failure.
1 parent 9ee598e commit 230cf8d

File tree

1 file changed

+6
-2
lines changed
  • src/backend/access/transam

1 file changed

+6
-2
lines changed

src/backend/access/transam/xlog.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.34 2000/11/25 20:33:50 tgl Exp $
9+
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.35 2000/11/27 05:36:12 tgl Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -860,7 +860,11 @@ XLogFileInit(uint32 log, uint32 seg, bool *usexistent)
860860
log, seg, 0);
861861

862862
close(fd);
863-
link(tpath, path);
863+
864+
if (link(tpath, path) < 0)
865+
elog(STOP, "InitRelink(logfile %u seg %u) failed: %m",
866+
logId, logSeg);
867+
864868
unlink(tpath);
865869

866870
fd = BasicOpenFile(path, O_RDWR | PG_BINARY, S_IRUSR | S_IWUSR);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy