diff options
author | Jeffrey Walton <noloader@gmail.com> | 2016-10-05 20:29:01 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2016-10-05 20:29:01 -0400 |
commit | 74dc41703d72516baa7a3d6cd46dcc7b138806d4 (patch) | |
tree | 5f90d4c84688963a6bd0df3c99c35bf80df98894 /ossig.h | |
parent | dc927defa1b7d1463477be401ab5d62417d44ead (diff) | |
download | cryptopp-git-74dc41703d72516baa7a3d6cd46dcc7b138806d4.tar.gz |
Fix Cygwin compile error due to sigemptyset (Issue 315)
Diffstat (limited to 'ossig.h')
-rw-r--r-- | ossig.h | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -82,12 +82,16 @@ struct SignalHandler // Don't step on another's handler if Overwrite=false
if (m_old.sa_handler != 0 && !O) break;
- // Sun Studio 12.2-12.4 needs the two casts, and they must be C-style casts
- new_handler.sa_handler = (pfn ? pfn : &NullSignalHandler);
- new_handler.sa_flags = (pfn ? flags : 0);
-
+#if defined __CYGWIN__
+ // http://github.com/weidai11/cryptopp/issues/315
+ memset(&new_handler, 0x00, sizeof(new_handler));
+#else
ret = sigemptyset (&new_handler.sa_mask);
if (ret != 0) break; // Failed
+#endif
+
+ new_handler.sa_handler = (pfn ? pfn : &NullSignalHandler);
+ new_handler.sa_flags = (pfn ? flags : 0);
// Install it
ret = sigaction (S, &new_handler, 0);
|