projects
/
ossec-hids.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
obrisane nepotrebne datoteke od zadnjeg builda
[ossec-hids.git]
/
src
/
shared
/
sig_op.c
diff --git
a/src/shared/sig_op.c
b/src/shared/sig_op.c
old mode 100755
(executable)
new mode 100644
(file)
index
bde3a72
..
4ab5641
--- a/
src/shared/sig_op.c
+++ b/
src/shared/sig_op.c
@@
-1,5
+1,3
@@
-/* @(#) $Id$ */
-
/* Copyright (C) 2009 Trend Micro Inc.
* All right reserved.
*
/* Copyright (C) 2009 Trend Micro Inc.
* All right reserved.
*
@@
-9,47
+7,44
@@
* Foundation
*/
* Foundation
*/
-
-/* Functions to handle signal manipulation
- */
+/* Functions to handle signal manipulation */
#ifndef WIN32
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#ifndef WIN32
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
+#include <string.h>
#include "sig_op.h"
#include "file_op.h"
#include "debug_op.h"
#include "sig_op.h"
#include "file_op.h"
#include "debug_op.h"
-
#include "error_messages/error_messages.h"
#include "error_messages/error_messages.h"
-char *pidfile = NULL;
+static const char *pidfile = NULL;
+
-void HandleSIG()
+void HandleSIG(int sig)
{
{
- merror(SIGNAL_RECV, pidfile);
-
+ merror(SIGNAL_RECV, pidfile, sig, strsignal(sig));
+
DeletePID(pidfile);
DeletePID(pidfile);
-
+
exit(1);
}
/* To avoid client-server communication problems */
exit(1);
}
/* To avoid client-server communication problems */
-void HandleSIGPIPE()
+void HandleSIGPIPE(__attribute__((unused)) int sig)
{
return;
}
{
return;
}
-void StartSIG(char *process_name)
+void StartSIG(const char *process_name)
{
{
- /* Signal Manipulation
- go to HandleSIG() */
pidfile = process_name;
pidfile = process_name;
- signal(SIGHUP, SIG_IGN);
+ signal(SIGHUP, SIG_IGN);
signal(SIGINT, HandleSIG);
signal(SIGQUIT, HandleSIG);
signal(SIGTERM, HandleSIG);
signal(SIGINT, HandleSIG);
signal(SIGQUIT, HandleSIG);
signal(SIGTERM, HandleSIG);
@@
-57,7
+52,7
@@
void StartSIG(char *process_name)
signal(SIGPIPE, HandleSIGPIPE);
}
signal(SIGPIPE, HandleSIGPIPE);
}
-void StartSIG2(char *process_name, void (*func)(int))
+void StartSIG2(const char *process_name, void (*func)(int))
{
pidfile = process_name;
{
pidfile = process_name;
@@
-69,5
+64,5
@@
void StartSIG2(char *process_name, void (*func)(int))
signal(SIGPIPE, HandleSIGPIPE);
}
signal(SIGPIPE, HandleSIGPIPE);
}
-#endif
-/* EOF */
+#endif /* !WIN32 */
+