deletion of comments and the hashlist
Posted: Fri Aug 14, 2009 9:24 pm
This is a multi-part message in MIME format.
--------------040803050507080800000506
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
I noticed that this diff has not been committed, but I didn't get
feedback on why if it was rejected. any comments would be appreciated.
-------- Original Message --------
Subject: deletion of comments and the hashlist
Date: Sat, 27 Jun 2009 22:06:19 +0200
From: Hiren Patel
Reply-To: [email protected]
To: Nagios Developers List
wondering if the attached diff is valid, from what I see, if the comment
being deleted is the first in the hashlist, the hashlist is made null
without checking if the comment had other comments below it. the diff
makes the hashlist point to the next comment if this comment has others
below. I'm not sure what the side effects of this would be or how to
test a fix, any comments appreciated.
--------------040803050507080800000506
Content-Type: text/x-patch;
name="comments.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="comments.diff"
--- common/comments.c 2008-11-30 19:22:58.000000000 +0200
+++ /tmp/comments.c 2009-06-27 21:58:30.000000000 +0200
@@ -199,7 +199,10 @@
if(last_hash)
last_hash->nexthash=this_hash->nexthash;
else
- comment_hashlist[hashslot]=NULL;
+ if (this_hash->nexthash)
+ comment_hashlist[hashslot]=this_hash->nexthash;
+ else
+ comment_hashlist[hashslot]=NULL;
break;
}
last_hash=this_hash;
--------------040803050507080800000506--
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
--------------040803050507080800000506
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
I noticed that this diff has not been committed, but I didn't get
feedback on why if it was rejected. any comments would be appreciated.
-------- Original Message --------
Subject: deletion of comments and the hashlist
Date: Sat, 27 Jun 2009 22:06:19 +0200
From: Hiren Patel
Reply-To: [email protected]
To: Nagios Developers List
wondering if the attached diff is valid, from what I see, if the comment
being deleted is the first in the hashlist, the hashlist is made null
without checking if the comment had other comments below it. the diff
makes the hashlist point to the next comment if this comment has others
below. I'm not sure what the side effects of this would be or how to
test a fix, any comments appreciated.
--------------040803050507080800000506
Content-Type: text/x-patch;
name="comments.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="comments.diff"
--- common/comments.c 2008-11-30 19:22:58.000000000 +0200
+++ /tmp/comments.c 2009-06-27 21:58:30.000000000 +0200
@@ -199,7 +199,10 @@
if(last_hash)
last_hash->nexthash=this_hash->nexthash;
else
- comment_hashlist[hashslot]=NULL;
+ if (this_hash->nexthash)
+ comment_hashlist[hashslot]=this_hash->nexthash;
+ else
+ comment_hashlist[hashslot]=NULL;
break;
}
last_hash=this_hash;
--------------040803050507080800000506--
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]