aboutsummaryrefslogtreecommitdiff
path: root/src/include/port/win32.h
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2006-07-30 01:45:21 +0000
committerBruce Momjian <bruce@momjian.us>2006-07-30 01:45:21 +0000
commit1a271f0c71294c47444a15d93bc064d3a4f23674 (patch)
treee2ff357a47ea93dc18157434855696557e25194c /src/include/port/win32.h
parent497d39d76815a54917c4907c73451ecb715b1fe2 (diff)
downloadpostgresql-1a271f0c71294c47444a15d93bc064d3a4f23674.tar.gz
postgresql-1a271f0c71294c47444a15d93bc064d3a4f23674.zip
Fix WIN32 wait() return value macros to be accurate, particularly
because they are used for testing the return value from system(). (WIN32 doesn't overlay the return code with other failure conditions like Unix does, so they are just simple macros.) Fix regression checks to properly handle diff failures on Win32 using the new macros.
Diffstat (limited to 'src/include/port/win32.h')
-rw-r--r--src/include/port/win32.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/include/port/win32.h b/src/include/port/win32.h
index 7a9180ea9c8..fa57c25b3c2 100644
--- a/src/include/port/win32.h
+++ b/src/include/port/win32.h
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.53 2006/07/16 20:17:04 tgl Exp $ */
+/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.54 2006/07/30 01:45:21 momjian Exp $ */
/* undefine and redefine after #include */
#undef mkdir
@@ -109,12 +109,17 @@ int semop(int semId, struct sembuf * sops, int flag);
/*
- * Signal stuff
+ * Signal stuff
+ * WIN32 doesn't have wait(), so the return value for children
+ * is simply the return value specified by the child, without
+ * any additional information on whether the child terminated
+ * on its own or via a signal. These macros are also used
+ * to interpret the return value of system().
*/
-#define WEXITSTATUS(w) (((w) >> 8) & 0xff)
-#define WIFEXITED(w) (((w) & 0xff) == 0)
-#define WIFSIGNALED(w) (((w) & 0x7f) > 0 && (((w) & 0x7f) < 0x7f))
-#define WTERMSIG(w) ((w) & 0x7f)
+#define WEXITSTATUS(w) (w)
+#define WIFEXITED(w) (true)
+#define WIFSIGNALED(w) (false)
+#define WTERMSIG(w) (0)
#define sigmask(sig) ( 1 << ((sig)-1) )