Commit a0b2fd83 authored by Mike Gabriel's avatar Mike Gabriel

sa_restorer vs. memset (008_nxcomp_sa-restorer.full+lite.patch).

Use memset instead of setting sa_restorer to NULL. Original-Author: Alexander Morozov
parent a720908a
Description: sa_restorer vs. memset
Use memset instead of setting sa_restorer to NULL.
Forwarded: pending
Author: Alexander Morozov
Last-Update: 2012-02-07
--- a/nxcomp/Loop.cpp
+++ b/nxcomp/Loop.cpp
@@ -5884,20 +5884,9 @@
struct sigaction newAction;
- newAction.sa_handler = HandleSignal;
-
- //
- // This field doesn't exist on most OSes except
- // Linux. We keep setting the field to NULL to
- // avoid side-effects in the case the field is
- // a value return.
- //
+ memset(&newAction, 0, sizeof(newAction));
- #if defined(__linux__)
-
- newAction.sa_restorer = NULL;
-
- #endif
+ newAction.sa_handler = HandleSignal;
sigemptyset(&(newAction.sa_mask));
@@ -6509,13 +6498,9 @@
struct sigaction action;
- action.sa_handler = HandleTimer;
-
- #if defined(__linux__)
+ memset(&action, 0, sizeof(action));
- action.sa_restorer = NULL;
-
- #endif
+ action.sa_handler = HandleTimer;
sigemptyset(&action.sa_mask);
008_nxcomp_sa-restorer.full+lite.patch
009_nxproxy_add-man-page.full+lite.patch
009_nxagent_add-man-page.full.patch
010_nxauth_fix-binary-name-in-man-page.full.patch
......
......@@ -5884,20 +5884,9 @@ void InstallSignal(int signal, int action)
struct sigaction newAction;
newAction.sa_handler = HandleSignal;
//
// This field doesn't exist on most OSes except
// Linux. We keep setting the field to NULL to
// avoid side-effects in the case the field is
// a value return.
//
memset(&newAction, 0, sizeof(newAction));
#if defined(__linux__)
newAction.sa_restorer = NULL;
#endif
newAction.sa_handler = HandleSignal;
sigemptyset(&(newAction.sa_mask));
......@@ -6509,13 +6498,9 @@ void SetTimer(int value)
struct sigaction action;
action.sa_handler = HandleTimer;
#if defined(__linux__)
memset(&action, 0, sizeof(action));
action.sa_restorer = NULL;
#endif
action.sa_handler = HandleTimer;
sigemptyset(&action.sa_mask);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment