public inbox for sourcenav@sourceware.org
 help / color / mirror / Atom feed
* bugfix for unloading problem
@ 2001-05-15  5:12 Khamis Abuelkomboz  UUNET
  0 siblings, 0 replies; only message in thread
From: Khamis Abuelkomboz  UUNET @ 2001-05-15  5:12 UTC (permalink / raw)
  To: sourcenav

The following patch fixes the problem, where sometimes some files
can't be unloaded. It seems that there is a bug in the database itself.
This bugfix is some workaround of this problem.
The complete file can be downloaded from
http://khamis.do-is.com/sn/dbsym.c
A already compiled hyper.exe can be downloaded from
http://khamis.do-is.com/sn/sn50/hyper.exe

khamis

--- /d/Packages/sn/SN451/snavigator/hyper/dbsym.c	Fri Feb 11 22:50:36 2000
+++ dbsym.c	Mon Apr 30 12:01:06 2001
@@ -945,6 +945,15 @@
  	 
	argc--;
  		}
  #endif
+ 
	/*
+ 
	* end of the script options
+ 
	*/
+ 
	else if (strcmp (argv[2], "--") == 0)
+ 
	{
+ 
		argv++;
+ 
		argc--;
+ 
		break;
+ 
	}
  		else
  		{
  	 
	Tcl_AppendResult(interp, argv[0]," ", argv[1],
@@ -2033,9 +2042,28 @@
  		LOGGER((LOGFP,"%ld records have been scanned from %ld\n",
  	 
	scan_counter,rec_counter));
  	}
+ 
else if (dbp->type == DB_BTREE)
+ 
{
+ 
	ret = dbp->del(dbp,&key,0);
+ 
	if (ret == 0)
+ 
	    counter ++;
+ 
	else for (flag = R_FIRST;
+ 
		dbp->seq(dbp,&key,&data,flag) == 0;
+ 
		flag = R_NEXT
+ 
		)
+ 
	{
+ 
		if (memcmp(key.data, key_pattern, key_pattern_size) == 0)
+ 
		{
+ 
			ret = dbp->del(dbp,&key,R_CURSOR);
+ 
			if (ret == 0)
+ 
				counter++;
+ 
			break;
+ 
		}
+ 
	}
+ 
}
  	else
  	{
- 
	ret = dbp->del(dbp,&key,flag);
+ 
	ret = dbp->del(dbp,&key,0);
  		if (ret == 0)
  	 
	counter++;
  	}
@@ -2048,7 +2076,7 @@

  		return -1;
  	}
- 
LOGGER((LOGFP,"%ld records have been deleted\n",counter));
+ 
LOGGER((LOGFP,"%ld records have been deleted, db-type=%s\n",counter, 
(dbp->type == DB_BTREE ? "btree" : "hash")));

  	return counter;
  }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-05-15  5:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-15  5:12 bugfix for unloading problem Khamis Abuelkomboz  UUNET

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).