[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Void functions returning NULL
From: |
Alexander Mattausch |
Subject: |
Re: Void functions returning NULL |
Date: |
Fri, 13 Sep 2002 11:10:22 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.1) Gecko/20020826 |
address@hidden schrieb:
The HPUX compiler is especially tough on these messages. Many of
them are caused by inconsistencies in datatypes between platforms.
The return values were a cut and paste error that have no effect
on the program, since the function is void. Mixing void and void*
is potentially more serious - can you be specific?
I had a similar problem on DEC Unix, the compiler failed in cfservd.c. I
have included a patch that makes cfservd.c compile (and run) with the
native compiler on DEC Unix.
This patch also changes protoype.h - it comments CheckDFSSACE. Without
that cfengine does not compile.
HTH
Alex
--- src/prototypes.h.orig Thu Jul 25 17:33:05 2002
+++ src/prototypes.h Thu Jul 25 17:33:24 2002
@@ -164,8 +164,8 @@
/* dce_acl.c */
-struct CFACE;
-int CheckDFSACE ARGLIST((struct CFACE *aces, char method, char *filename, enum
fileactions action));
+/*struct CFACE;
+int CheckDFSACE ARGLIST((struct CFACE *aces, char method, char *filename, enum
fileactions action));*/
/* df.c */
--- src/cfservd.c.orig Thu Aug 29 09:39:27 2002
+++ src/cfservd.c Thu Sep 5 16:57:38 2002
@@ -867,9 +867,7 @@
pthread_attr_init(&PTHREADDEFAULTS);
pthread_attr_setdetachstate(&PTHREADDEFAULTS,PTHREAD_CREATE_DETACHED);
-#ifdef HAVE_PTHREAD_ATTR_SETSTACKSIZE
pthread_attr_setstacksize(&PTHREADDEFAULTS,(size_t)1024*1024);
-#endif
if (pthread_create(&tid,&PTHREADDEFAULTS,(void *)HandleConnection,(void
*)conn) != 0)
{
@@ -3090,7 +3088,6 @@
{
CfLog(cferror,"pthread_mutex_lock failed","pthread_mutex_lock");
DeleteConn(conn);
- return NULL;
}
#endif
@@ -3101,7 +3098,6 @@
{
CfLog(cferror,"pthread_mutex_unlock failed","pthread_mutex_lock");
DeleteConn(conn);
- return NULL;
}
#endif
}