Fix typo in reference to __FreeBSD__.
authorThomas Munro <[email protected]>
Fri, 16 Dec 2022 04:36:22 +0000 (17:36 +1300)
committerThomas Munro <[email protected]>
Fri, 16 Dec 2022 04:36:22 +0000 (17:36 +1300)
Commit a2a8acd152 introduced a platform-dependent mechanism to prevent
developers from referencing errno in the argument list of
elog()/ereport(), but didn't use the right macro to detect FreeBSD, so
it didn't actually work there.

Reported-by: Japin Li <[email protected]>
Discussion: https://postgr.es/m/MEYP282MB16693AAEEF84F47D8F7CA007B6E69%40MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM

src/include/utils/elog.h

index 8025dce3357c57f07158bc35663a246d1b8cdee6..6e50c8580e66e4ca24ca4598669d8ffca055cc1a 100644 (file)
@@ -89,7 +89,7 @@ struct Node;
  */
 #if defined(errno) && defined(__linux__)
 #define pg_prevent_errno_in_scope() int __errno_location pg_attribute_unused()
-#elif defined(errno) && (defined(__darwin__) || defined(__freebsd__))
+#elif defined(errno) && (defined(__darwin__) || defined(__FreeBSD__))
 #define pg_prevent_errno_in_scope() int __error pg_attribute_unused()
 #else
 #define pg_prevent_errno_in_scope()