|
|
@ -825,16 +825,22 @@ CreateLockFile(const char *filename, bool amPostmaster, |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
if (isDDLock) |
|
|
|
if (isDDLock) |
|
|
|
{ |
|
|
|
{ |
|
|
|
char *ptr; |
|
|
|
char *ptr = NULL; |
|
|
|
unsigned long id1, |
|
|
|
unsigned long id1, |
|
|
|
id2; |
|
|
|
id2; |
|
|
|
|
|
|
|
int lineno; |
|
|
|
|
|
|
|
|
|
|
|
ptr = strchr(buffer, '\n'); |
|
|
|
for (lineno = 1; lineno <= 4; lineno++) |
|
|
|
if (ptr != NULL && |
|
|
|
|
|
|
|
(ptr = strchr(ptr + 1, '\n')) != NULL) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
if ((ptr = strchr(ptr, '\n')) == NULL) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
elog(LOG, "bogus data in \"%s\"", DIRECTORY_LOCK_FILE); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
ptr++; |
|
|
|
ptr++; |
|
|
|
if (sscanf(ptr, "%lu %lu", &id1, &id2) == 2) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ptr && sscanf(ptr, "%lu %lu", &id1, &id2) == 2) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (PGSharedMemoryIsInUse(id1, id2)) |
|
|
|
if (PGSharedMemoryIsInUse(id1, id2)) |
|
|
|
ereport(FATAL, |
|
|
|
ereport(FATAL, |
|
|
@ -849,7 +855,6 @@ CreateLockFile(const char *filename, bool amPostmaster, |
|
|
|
filename))); |
|
|
|
filename))); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Looks like nobody's home. Unlink the file and try again to create |
|
|
|
* Looks like nobody's home. Unlink the file and try again to create |
|
|
|