Giter Site home page Giter Site logo

hyperestraier-encore's Introduction

Hyper Estraier Encore: a full-text search system
Copyright (C) 2010 SATOH Fumiyasu @ OSS Technology, Inc.
======================================================================

This is derived from Hyper Estraier 1.4.13 by Mikio Hirabayashi.
(http://fallabs.com/hyperestraier/)

The original copyright notice is below:

  Hyper Estraier: a full-text search system for communities
  Copyright (C) 2004-2005 Mikio Hirabayashi

======================================================================

Please read the following documents with a WWW browser.
How to install QDBM is explained in the specification.

  README         - this file
  COPYING        - license
  ChangeLog      - history of enhancement
  THANKS         - list of contributors
  doc/index.html - index of documents


Contents of the directory tree is below.

  ./             - sources of Hyper Estraier Encore
  ./locale/      - locale files
  ./filter/      - filter scripts
  ./increm/      - files for incremental search
  ./emskel/      - skelton of configuration
  ./doc/         - manuals and specifications
  ./man/         - manuals for nroff
  ./javanative/  - sources of the Java binding
  ./javapure/    - sources of the pure Java interface
  ./rubynative/  - sources of the Ruby binding
  ./rubypure/    - sources of the pure Ruby interface
  ./win/         - files for Windows
  ./example/     - sample code of tutorial
  ./lab/         - for test and experiment
  ./misc/        - miscellaneous files


Hyper Estraier Encore is released under the terms of the GNU Lesser
General Public License Version 2.1. See the file `COPYING' for details.


Thanks.



== END OF FILE ==

hyperestraier-encore's People

Contributors

fumiyas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

hyperestraier-encore's Issues

Missing closing files?

The file at Line 4083 is not closed?

double est_random(void){
static int first = TRUE;
int num;
if(first && !est_random_ifp){
if((est_random_ifp = fopen("/dev/urandom", "rb")) != NULL){
atexit(est_random_fclose);
} else {
srand(getpid());
}
first = FALSE;
}
if(est_random_ifp){
fread(&num, sizeof(int), 1, est_random_ifp);
return (num & INT_MAX) / (double)INT_MAX;
}
return rand() / (double)RAND_MAX;
}

An improper locking due to the unreleased lock before program exit

Hi developers, in the below codes, the lock log_mutex could be not released before program's exit atexit(log_close); . I think there is no harm to pthread_mutex_unlock(&log_mutex); before the atexit(log_close); for better resource management and code symmetry, albeit some common OS would release the resource. Thanks!

if(pthread_mutex_lock(&log_mutex) != 0) return FALSE;
log_level = level;
if(log_fp){
fclose(log_fp);
log_fp = NULL;
}
#if defined(_WIN32)
if(!strcmp(path, "nul")) goto done;
#else
if(!strcmp(path, "/dev/null")) goto done;
#endif
if((ESTPATHCHR == '/' && path[0] == ESTPATHCHR) ||
(ESTPATHCHR == '\\' && ((path[0] >= 'A' && path[0] <= 'Z') ||
(path[0] >= 'a' && path[0] <= 'z')) && path[1] == ':' &&
path[2] == '\\')){
sprintf(mypath, "%s", path);
} else {
sprintf(mypath, "%s%c%s", rootdir, ESTPATHCHR, path);
}
if((log_fd = open(mypath, log_flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)) == -1) {
err = TRUE;
goto done;
}
if(level == LL_CHECK){
close(log_fd);
goto done;
}
if(!(log_fp = fdopen(log_fd, "ab"))) {
close(log_fd);
err = TRUE;
goto done;
}
atexit(log_close);
done:
pthread_mutex_unlock(&log_mutex);
return err ? FALSE : TRUE;
}

Missing closing files

fopen("/dev/urandom", "rb")) != NULL shoule be closed in the method est_random?

double est_random(void){
static int first = TRUE;
int num;
if(first && !est_random_ifp){
if((est_random_ifp = fopen("/dev/urandom", "rb")) != NULL){
atexit(est_random_fclose);
} else {
srand(getpid());
}
first = FALSE;
}
if(est_random_ifp){
fread(&num, sizeof(int), 1, est_random_ifp);
return (num & INT_MAX) / (double)INT_MAX;
}
return rand() / (double)RAND_MAX;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.