INN commit: trunk/innd (cc.c innd.h nc.c)

INN Commit rra at isc.org
Wed Jul 6 17:15:24 UTC 2011


    Date: Wednesday, July 6, 2011 @ 10:15:24
  Author: iulius
Revision: 9221

clean up innd code

Add the "noreturn" attribute to two functions.

Fix a typo, add a comment, add an explicit comparison to NULL.

Modified:
  trunk/innd/cc.c
  trunk/innd/innd.h
  trunk/innd/nc.c

--------+
 cc.c   |    3 ++-
 innd.h |    4 ++--
 nc.c   |    2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

Modified: cc.c
===================================================================
--- cc.c	2011-07-06 17:13:41 UTC (rev 9220)
+++ cc.c	2011-07-06 17:15:24 UTC (rev 9221)
@@ -680,7 +680,7 @@
     Mode = OMrunning;
     ThrottledbyIOError = false;
 
-    if (NNRPReason && !innconf->readerswhenstopped) {
+    if (NNRPReason != NULL && !innconf->readerswhenstopped) {
 	av[0] = YES;
 	av[1] = p;
 	CCreaders(av);
@@ -1178,6 +1178,7 @@
     if (ModeReason)
 	free(ModeReason);
     ModeReason = xstrdup(reason);
+    /* Disallow readers when the server is paused or throttled. */
     if (NNRPReason == NULL && !innconf->readerswhenstopped) {
 	av[0] = NO;
 	av[1] = ModeReason;

Modified: innd.h
===================================================================
--- innd.h	2011-07-06 17:13:41 UTC (rev 9220)
+++ innd.h	2011-07-06 17:15:24 UTC (rev 9221)
@@ -693,7 +693,7 @@
 extern char         *	MaxLength(const char *p, const char *q);
 extern pid_t		Spawn(int niceval, int fd0, int fd1, int fd2,
 			      char * const av[]);
-extern void		CleanupAndExit(int x, const char *why);
+extern void		CleanupAndExit(int x, const char *why) __attribute__ ((noreturn));
 extern void		JustCleanup(void);
 extern void		ThrottleIOError(const char *when);
 extern void		ThrottleNoMatchError(void);
@@ -723,7 +723,7 @@
 extern char	    *   CHANname(CHANNEL *cp);
 extern int		CHANreadtext(CHANNEL *cp);
 extern void		CHANclose(CHANNEL *cp, const char *name);
-extern void		CHANreadloop(void);
+extern void		CHANreadloop(void) __attribute__ ((noreturn));
 extern void		CHANsetup(int i);
 extern void		CHANshutdown(void);
 extern void		CHANtracing(CHANNEL *cp, bool Flag);

Modified: nc.c
===================================================================
--- nc.c	2011-07-06 17:13:41 UTC (rev 9220)
+++ nc.c	2011-07-06 17:15:24 UTC (rev 9221)
@@ -151,7 +151,7 @@
     int i;
 
     /* XXX could do RCHANremove(cp) here, as the old NCwritetext() used to
-     * do, but that would be wrong if the channel is sreaming (because it
+     * do, but that would be wrong if the channel is streaming (because it
      * would zap the channel's input buffer).  There's no harm in
      * never calling RCHANremove here.  */
 




More information about the inn-committers mailing list