Browse code

core: better check for cloned lumps in shared memory

- bitwise test for LUMPFLAG_SHMEM

Daniel-Constantin Mierla authored on 24/11/2011 14:26:47
Showing 1 changed files
... ...
@@ -650,7 +650,7 @@ void del_nonshm_lump( struct lump** lump_list )
650 650
 	crt = *lump_list;
651 651
 
652 652
 	while (crt) {
653
-		if (crt->flags!=LUMPFLAG_SHMEM) {
653
+		if (!(crt->flags&LUMPFLAG_SHMEM)) {
654 654
 			/* unlink it */
655 655
 			foo = crt;
656 656
 			crt = crt->next;
... ...
@@ -665,7 +665,7 @@ void del_nonshm_lump( struct lump** lump_list )
665 665
 			prev_r = crt;
666 666
 			while(r){
667 667
 				foo=r; r=r->after;
668
-				if (foo->flags!=LUMPFLAG_SHMEM) {
668
+				if (!(foo->flags&LUMPFLAG_SHMEM)) {
669 669
 					prev_r->after = r;
670 670
 					free_lump(foo);
671 671
 					pkg_free(foo);
... ...
@@ -678,7 +678,7 @@ void del_nonshm_lump( struct lump** lump_list )
678 678
 			prev_r = crt;
679 679
 			while(r){
680 680
 				foo=r; r=r->before;
681
-				if (foo->flags!=LUMPFLAG_SHMEM) {
681
+				if (!(foo->flags&LUMPFLAG_SHMEM)) {
682 682
 					prev_r->before = r;
683 683
 					free_lump(foo);
684 684
 					pkg_free(foo);