public inbox for sourcenav@sourceware.org
 help / color / mirror / Atom feed
From: khamis2@t-online.de (Khamis Abuelkomboz  UUNET)
To: sourcenav@sources.redhat.com
Subject: bugfix for unloading problem
Date: Tue, 15 May 2001 05:12:00 -0000	[thread overview]
Message-ID: <3B011E64.60909@knuut.de> (raw)

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;
  }

                 reply	other threads:[~2001-05-15  5:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3B011E64.60909@knuut.de \
    --to=khamis2@t-online.de \
    --cc=sourcenav@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).