summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-03-16 16:25:42 -0300
committerPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-11-28 04:31:52 -0200
commite06eddafd5f72f6f0782e37e9617c2e874021038 (patch)
tree972a90ccba9466c6ac0d60b7d9d4576c6e5bcc23
parentf1a527497c9621428cdb78dd9d37cb846ec10544 (diff)
Compile warning fixes.
Include header with prototypes for signals.c, and change prototypes and definitions to match. This should not have any side effects as function arguments are ignored. Ansify some functions with K&R definitions. printhex.c:fprintfhex() could be changed to a "sane" implementation, but only change was "ansification".
-rw-r--r--list.c32
-rw-r--r--printhex.c9
-rw-r--r--signals.c21
-rw-r--r--xsm.h8
4 files changed, 29 insertions, 41 deletions
diff --git a/list.c b/list.c
index 25d2647..fa09edc 100644
--- a/list.c
+++ b/list.c
@@ -27,7 +27,7 @@ in this Software without prior written authorization from The Open Group.
#include "xsm.h"
List *
-ListInit()
+ListInit(void)
{
List *l;
@@ -40,24 +40,21 @@ ListInit()
}
List *
-ListFirst(l)
-List *l;
+ListFirst(List *l)
{
if(l->next->thing) return l->next;
else return NULL;
}
List *
-ListNext(l)
-List *l;
+ListNext(List *l)
{
if(l->next->thing) return l->next;
else return NULL;
}
void
-ListFreeAll(l)
-List *l;
+ListFreeAll(List *l)
{
char *thing;
List *next;
@@ -72,8 +69,7 @@ List *l;
}
void
-ListFreeAllButHead(l)
-List *l;
+ListFreeAllButHead(List *l)
{
List *p, *next;
@@ -91,9 +87,7 @@ List *l;
}
List *
-ListAddFirst(l, v)
-List *l;
-char *v;
+ListAddFirst(List *l, char *v)
{
List *e;
@@ -110,9 +104,7 @@ char *v;
}
List *
-ListAddLast(l, v)
-List *l;
-char *v;
+ListAddLast(List *l, char *v)
{
List *e;
@@ -129,8 +121,7 @@ char *v;
}
void
-ListFreeOne(e)
-List *e;
+ListFreeOne(List *e)
{
e->next->prev = e->prev;
e->prev->next = e->next;
@@ -139,9 +130,7 @@ List *e;
Status
-ListSearchAndFreeOne(l,thing)
-List *l;
-char *thing;
+ListSearchAndFreeOne(List *l, char *thing)
{
List *p;
@@ -157,8 +146,7 @@ char *thing;
int
-ListCount(l)
-List *l;
+ListCount(List *l)
{
int i;
List *e;
diff --git a/printhex.c b/printhex.c
index b411f9e..f14ab8b 100644
--- a/printhex.c
+++ b/printhex.c
@@ -24,7 +24,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
******************************************************************************/
-#include <stdio.h>
+#include "xsm.h"
static char *hex_table[] = { /* for printing hex digits */
"00", "01", "02", "03", "04", "05", "06", "07",
@@ -63,12 +63,7 @@ static char *hex_table[] = { /* for printing hex digits */
void
-fprintfhex (fp, len, cp)
-
-register FILE *fp;
-unsigned int len;
-char *cp;
-
+fprintfhex(register FILE *fp, unsigned int len, char *cp)
{
unsigned char *ucp = (unsigned char *) cp;
diff --git a/signals.c b/signals.c
index 9be9bab..fb9c34d 100644
--- a/signals.c
+++ b/signals.c
@@ -98,15 +98,16 @@ in this Software without prior written authorization from The Open Group.
#include <stddef.h>
+#include "xsm.h"
+
int checkpoint_from_signal = 0;
extern XtSignalId sig_term_id, sig_usr1_id;
extern Bool wantShutdown;
-SIGVAL (*Signal (sig, handler))()
- int sig;
- SIGVAL (*handler)();
+static SIGVAL
+Signal(int sig, SIGVAL (*handler)(int))
{
#ifndef X_NOT_POSIX
struct sigaction sigact, osigact;
@@ -114,15 +115,20 @@ SIGVAL (*Signal (sig, handler))()
sigemptyset(&sigact.sa_mask);
sigact.sa_flags = 0;
sigaction(sig, &sigact, &osigact);
+# if defined(SIGNALRETURNSINT)
return osigact.sa_handler;
+# endif
#else
- return signal(sig, handler);
+# if defined(SIGNALRETURNSINT)
+ return
+# endif
+ signal(sig, handler);
#endif
}
void
-sig_child_handler (XtPointer closure, XtSignalId id)
+sig_child_handler (int sig)
{
int pid, olderrno = errno;
@@ -231,10 +237,7 @@ register_signals (XtAppContext appContext)
int
-execute_system_command (s)
-
-char *s;
-
+execute_system_command (char *s)
{
int stat;
diff --git a/xsm.h b/xsm.h
index cf48cb2..d6fa0b7 100644
--- a/xsm.h
+++ b/xsm.h
@@ -210,9 +210,11 @@ extern void remote_start(char *restart_protocol, char *restart_machine,
char *non_local_session_env );
/* signals.c */
-extern void sig_child_handler(void);
-extern void sig_term_handler(void);
-extern void sig_usr1_handler(void);
+extern void sig_child_handler(int sig);
+extern void sig_term_handler(int sig);
+extern void sig_usr1_handler(int sig);
+extern void xt_sig_term_handler(XtPointer closure, XtSignalId *id);
+extern void xt_sig_usr1_handler(XtPointer closure, XtSignalId *id);
extern void register_signals(XtAppContext);
extern int execute_system_command(char *s);