aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author7 <notzed@helixcode.com>2000-05-07 13:04:31 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-05-07 13:04:31 +0800
commit97505d53504d42a41b4dd61ba99cb784e665d6c4 (patch)
tree46812d6024db2698dbbece6663be03d54ad9f75a
parentcca467781c7ced39d93dc7ee03197717fd3e563b (diff)
downloadgsoc2013-evolution-97505d53504d42a41b4dd61ba99cb784e665d6c4.tar.gz
gsoc2013-evolution-97505d53504d42a41b4dd61ba99cb784e665d6c4.tar.zst
gsoc2013-evolution-97505d53504d42a41b4dd61ba99cb784e665d6c4.zip
Also close the fd after we're done.
2000-05-07 <notzed@helixcode.com> * file.c (ibex_open): Also close the fd after we're done. svn path=/trunk/; revision=2859
-rw-r--r--libibex/ChangeLog4
-rw-r--r--libibex/file.c9
2 files changed, 11 insertions, 2 deletions
diff --git a/libibex/ChangeLog b/libibex/ChangeLog
index abd1914e84..016416574f 100644
--- a/libibex/ChangeLog
+++ b/libibex/ChangeLog
@@ -1,4 +1,6 @@
-2000-05-06 NotZed <NotZed@HelixCode.com>
+2000-05-07 <notzed@helixcode.com>
+
+ * file.c (ibex_open): Also close the fd after we're done.
* find.c (ibex_contains_name): New function to find out if a file
is indexed.
diff --git a/libibex/file.c b/libibex/file.c
index 5c292e198f..462fbec3d4 100644
--- a/libibex/file.c
+++ b/libibex/file.c
@@ -114,6 +114,7 @@ ibex_open (char *file, int flags, int mode)
if (f == NULL) {
if (errno == 0)
errno = ENOMEM;
+ close(fd);
return NULL;
}
@@ -124,12 +125,16 @@ ibex_open (char *file, int flags, int mode)
ib->words = g_hash_table_new (g_str_hash, g_str_equal);
ib->oldfiles = g_ptr_array_new ();
- if (!f)
+ if (!f) {
+ close(fd);
return ib;
+ }
/* Check version. If its empty, then we have just created it */
if (fread (vbuf, 1, sizeof (vbuf), f) != sizeof (vbuf)) {
if (feof (f)) {
+ fclose(f);
+ close(fd);
return ib;
}
}
@@ -177,11 +182,13 @@ ibex_open (char *file, int flags, int mode)
g_free (ibfs);
fclose (f);
+ close(fd);
return ib;
errout:
fclose (f);
+ close(fd);
g_tree_traverse (ib->files, free_file, G_IN_ORDER, NULL);
g_tree_destroy (ib->files);
g_hash_table_foreach (ib->words, free_word, NULL);
span>/+59 * The FreeBSD x11@ and graphics team proudly presentszeising2014-04-171-0/+1 * . Don't statically link libexecinfo.a. This doesn't appear to be necessaryglewis2014-04-151-27/+0 * . Don't use inline on functions that are intended to be used in multipleglewis2014-04-1410-0/+170 * . Don't try to represent a unicode literal in a character literal. In thisglewis2014-04-141-3/+14 * Add NO_STAGE all over the place in preparation for the staging support (cat: ...bapt2013-09-211-0/+1 * Add an explicit dependency on pkgconfantoine2013-09-102-1/+2 * . More portlint petting (fix patch file names).glewis2013-07-088-0/+0 * . Update to 2.2.12.glewis2013-07-086-124/+82 * - Convert USE_ICONV=yes to USES=iconvmva2013-04-281-1/+1 * - update png to 1.5.10dinoex2012-06-013-1/+32 * . Change gif dependency from libungif to giflib due to the latter being theglewis2012-02-261-2/+2 * - Add LDFLAGS to CONFIGURE_ENV and MAKE_ENV (as it was done with LDFLAGS)amdmi32011-09-241-1/+0 * . Update to 2.2.11.glewis2011-04-182-4/+3 * - Get Rid MD5 supportmiwi2011-03-201-1/+0 * - update to 1.4.1dinoex2010-03-281-2/+2 * - update to jpeg-8dinoex2010-02-051-1/+2 * . Fix a whitespace bogon.glewis2009-09-061-3/+3 * . Update to 2.2.9.glewis2009-08-248-81/+12 * - Switch SourceForge ports to the new File Release System: categories startin...amdmi32009-08-221-2/+2 * - update to jpeg7dinoex2009-07-181-2/+2 * - Fix build on sparc64gahr2008-09-162-1/+15 * Bump portrevision due to upgrade of devel/gettext.edwin2008-06-061-1/+1 * - Remove unneeded dependency from gtk12/gtk20 [1]miwi2008-04-201-2/+2 * . Asymptotically approaching packing list correctness.glewis2008-04-042-1/+2 * . Fix how the packing list is done with respect to the Gnome desktop file.glewis2008-04-022-9/+2 * . Update to 2.2.8.glewis2008-03-304-53/+26 * . Seeing intermittent build failures on 7.x and 8.x, so mark it asglewis2008-03-031-0/+3 * Remove BROKEN: now installs.erwin2008-01-041-3/+0 * Mark as broken in i386: gets core dump while trying to install.linimon2007-11-251-0/+3 * - Fix plistpav2007-11-132-0/+2 * . Update to 2.2.7.glewis2007-10-294-14/+14 * - share/pixmaps is listed in mtreepav2007-07-311-1/+0 * . Restore file mistakenly removed from the packing list in the lastglewis2007-07-222-0/+2 * . Don't create bogus ${DATADIR}_old directory. The ports system ensuresglewis2007-07-122-1/+25 * . Update to 2.2.6.glewis2007-07-123-16/+103 * - Welcome X.org 7.2 \o/.flz2007-05-202-1/+3 * . Sort LIB_DEPENDS and CONFIGURE_ARGS.glewis2007-02-061-11/+11 * . Update to 2.2.4.glewis2007-02-044-8/+73 * . Update to 2.2.3.glewis2007-02-044-116/+131 * . Fix the packing list.glewis2006-10-191-2/+3 * - Remove symlinks created by mtree target from plistspav2006-10-081-2/+0 * . Make portlint little bit happier.glewis2006-09-071-1/+1 * . Update to 2.2.2.glewis2006-08-0213-2025/+393 * - Use canonical (official) spelling of `NeXTstep' in pkg-descrdanfe2005-12-262-9/+6 * . Add SHA256.glewis2005-11-161-0/+1 * Bump PORTREVISION to chase the glib20 shared library update.marcus2005-11-051-0/+1 * . Update to 2.1.2.glewis2005-07-204-19/+36 * . Update to 2.1.1.glewis2005-06-114-80/+7 * . Reorder the test for GTK2 so its only done when it may be needed.glewis2005-05-201-4/+20 * . Update to 2.1.0.glewis2005-05-194-28/+58 * . share/afterstep -> %%DATADIR%%.glewis2005-05-051-2995/+2995 * . Update to 2.00.05.glewis2005-05-056-34/+83 * . Add a patch to fix the build on FreeBSD 4.x, forgotten in the previousglewis2005-04-081-0/+14 * . Update to 2.00.04.glewis2005-04-053-17/+72 * BROKEN on sparc64: Does not buildkris2005-03-271-1/+7 * . Update to 2.00.03.glewis2005-03-184-23/+103 * . Add missing dependencies.glewis2005-02-231-1/+3 * . FreeBSD has <limits.h>.glewis2005-02-211-0/+17 * . Update to 2.00.02.glewis2005-02-214-23/+45 * . Add missing manual pages.glewis2004-12-181-2/+3 * Update to version 2.00.01krion2004-12-064-18/+13 * . This is sh, not C. Use '=', not '=='.glewis2004-11-101-0/+22 * . Don't use malloc.h for malloc(3) on FreeBSD, use stdlib.h. Thisglewis2004-11-101-0/+13 * . I use afterstep, so take maintainership.glewis2004-11-101-1/+1 * Drop maintainership.demon2004-11-091-1/+1 * Update to version 2.00.00krion2004-10-13