[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libextractor] 02/03: get rid of plibc.h
From: |
gnunet |
Subject: |
[libextractor] 02/03: get rid of plibc.h |
Date: |
Sat, 30 Jan 2021 15:28:48 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository libextractor.
commit 0ad12329a7a4dc89ae63e8b032badf559b4f5550
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sat Jan 30 14:21:49 2021 +0100
get rid of plibc.h
---
src/include/Makefile.am | 5 ++-
src/include/platform.h | 2 --
src/main/extract.c | 70 +++++++++++++++++++--------------------
src/main/extractor.c | 3 +-
src/main/extractor_datasource.c | 18 +++++-----
src/main/extractor_ipc_gnu.c | 3 +-
src/main/extractor_ipc_w32.c | 2 +-
src/main/extractor_plugin_main.c | 1 -
src/main/extractor_plugins.h | 1 -
src/main/extractor_plugpath.c | 17 +++++-----
src/main/test_bzip2.c | 2 +-
src/main/test_file.c | 2 +-
src/main/test_gzip.c | 2 +-
src/main/test_ipc.c | 2 +-
src/main/test_plugin_load_multi.c | 2 +-
src/main/test_plugin_loading.c | 2 +-
src/main/test_trivial.c | 2 +-
src/plugins/fuzz_default.sh | 4 +--
src/plugins/gif_extractor.c | 6 ++--
src/plugins/old/ebml_extractor.c | 6 ++--
src/plugins/rpm_extractor.c | 14 ++++----
21 files changed, 79 insertions(+), 87 deletions(-)
diff --git a/src/include/Makefile.am b/src/include/Makefile.am
index a81ffc2..db3dcf1 100644
--- a/src/include/Makefile.am
+++ b/src/include/Makefile.am
@@ -1,8 +1,7 @@
# This Makefile.am is in the public domain
-SUBDIRS = .
+SUBDIRS = .
include_HEADERS = \
- extractor.h
+ extractor.h
EXTRA_DIST = \
- plibc.h \
platform.h \
gettext.h
diff --git a/src/include/platform.h b/src/include/platform.h
index 9f72f57..b457a72 100644
--- a/src/include/platform.h
+++ b/src/include/platform.h
@@ -35,8 +35,6 @@
#define _(a) dgettext ("org.gnunet.libextractor", a)
#endif
-#include "plibc.h"
-
#include <string.h>
#include <unistd.h>
#include <ctype.h>
diff --git a/src/main/extract.c b/src/main/extract.c
index 144f2c3..5efc53a 100644
--- a/src/main/extract.c
+++ b/src/main/extract.c
@@ -70,7 +70,7 @@ ignore_sigpipe ()
sig.sa_flags = SA_RESTART;
#endif
if (0 != sigaction (SIGPIPE, &sig, &oldsig))
- FPRINTF (stderr,
+ fprintf (stderr,
"Failed to install SIGPIPE handler: %s\n", strerror (errno));
}
@@ -290,7 +290,7 @@ print_selected_keywords (void *cls,
if (YES != print[type])
return 0;
if (verbose > 3)
- FPRINTF (stdout,
+ fprintf (stdout,
_ ("Found by `%s' plugin:\n"),
plugin_name);
mt = EXTRACTOR_metatype_to_string (type);
@@ -298,7 +298,7 @@ print_selected_keywords (void *cls,
switch (format)
{
case EXTRACTOR_METAFORMAT_UNKNOWN:
- FPRINTF (stdout,
+ fprintf (stdout,
_ ("%s - (unknown, %u bytes)\n"),
stype,
(unsigned int) data_len);
@@ -317,7 +317,7 @@ print_selected_keywords (void *cls,
keyword = strdup (data);
if (NULL != keyword)
{
- FPRINTF (stdout,
+ fprintf (stdout,
"%s - %s\n",
stype,
keyword);
@@ -329,13 +329,13 @@ print_selected_keywords (void *cls,
#endif
break;
case EXTRACTOR_METAFORMAT_BINARY:
- FPRINTF (stdout,
+ fprintf (stdout,
_ ("%s - (binary, %u bytes)\n"),
stype,
(unsigned int) data_len);
break;
case EXTRACTOR_METAFORMAT_C_STRING:
- FPRINTF (stdout,
+ fprintf (stdout,
"%s - %.*s\n",
stype,
(int) data_len,
@@ -392,7 +392,7 @@ print_selected_keywords_grep_friendly (void *cls,
if (0 == data_len)
return 0;
if (verbose > 1)
- FPRINTF (stdout,
+ fprintf (stdout,
"%s: ",
gettext (mt));
#if HAVE_ICONV
@@ -406,7 +406,7 @@ print_selected_keywords_grep_friendly (void *cls,
keyword = strdup (data);
if (NULL != keyword)
{
- FPRINTF (stdout,
+ fprintf (stdout,
"`%s' ",
keyword);
free (keyword);
@@ -420,10 +420,10 @@ print_selected_keywords_grep_friendly (void *cls,
break;
case EXTRACTOR_METAFORMAT_C_STRING:
if (verbose > 1)
- FPRINTF (stdout,
+ fprintf (stdout,
"%s ",
gettext (mt));
- FPRINTF (stdout,
+ fprintf (stdout,
"`%s'",
data);
break;
@@ -575,7 +575,7 @@ finish_bibtex (const char *fn)
if ( (NULL == btm[0].value) ||
(NULL == btm[1].value) ||
(NULL == btm[2].value) )
- FPRINTF (stdout,
+ fprintf (stdout,
"@%s %s { ",
et,
fn);
@@ -592,18 +592,18 @@ finish_bibtex (const char *fn)
temp[n] = '_';
else
temp[n] = tolower ( (unsigned char) temp[n]);
- FPRINTF (stdout,
+ fprintf (stdout,
"@%s %s { ",
et,
temp);
}
for (i = 0; NULL != btm[i].bibTexName; i++)
if (NULL != btm[i].value)
- FPRINTF (stdout,
+ fprintf (stdout,
"\t%s = {%s},\n",
btm[i].bibTexName,
btm[i].value);
- FPRINTF (stdout, "%s", "}\n\n");
+ fprintf (stdout, "%s", "}\n\n");
}
@@ -775,7 +775,7 @@ main (int argc, char *argv[])
#endif
if (NULL == (print = malloc (sizeof (int) * EXTRACTOR_metatype_get_max ())))
{
- FPRINTF (stderr,
+ fprintf (stderr,
"malloc failed: %s\n",
strerror (errno));
return 1;
@@ -785,7 +785,7 @@ main (int argc, char *argv[])
if (0 != _get_utf8_args (argc, argv, &utf8_argc, &utf8_argv))
{
- FPRINTF (stderr, "Failed to get arguments: %s\n", strerror (errno));
+ fprintf (stderr, "Failed to get arguments: %s\n", strerror (errno));
return 1;
}
@@ -821,7 +821,7 @@ main (int argc, char *argv[])
bibtex = YES;
if (NULL != processor)
{
- FPRINTF (stderr,
+ fprintf (stderr,
"%s",
_ (
"Illegal combination of options, cannot combine multiple
styles of printing.\n"));
@@ -834,7 +834,7 @@ main (int argc, char *argv[])
grepfriendly = YES;
if (NULL != processor)
{
- FPRINTF (stderr,
+ fprintf (stderr,
"%s",
_ (
"Illegal combination of options, cannot combine multiple
styles of printing.\n"));
@@ -869,7 +869,7 @@ main (int argc, char *argv[])
case 'p':
if (NULL == optarg)
{
- FPRINTF (stderr,
+ fprintf (stderr,
_ (
"You must specify an argument for the `%s' option (option
ignored).\n"),
"-p");
@@ -898,7 +898,7 @@ main (int argc, char *argv[])
}
if (NULL == EXTRACTOR_metatype_to_string (i))
{
- FPRINTF (stderr,
+ fprintf (stderr,
"Unknown keyword type `%s', use option `%s' to get a list.\n",
optarg,
"-L");
@@ -929,7 +929,7 @@ main (int argc, char *argv[])
}
if (NULL == EXTRACTOR_metatype_to_string (i))
{
- FPRINTF (stderr,
+ fprintf (stderr,
"Unknown keyword type `%s', use option `%s' to get a list.\n",
optarg,
"-L");
@@ -938,7 +938,7 @@ main (int argc, char *argv[])
}
break;
default:
- FPRINTF (stderr,
+ fprintf (stderr,
"%s",
_ ("Use --help to get a list of options.\n"));
free (utf8_argv);
@@ -947,7 +947,7 @@ main (int argc, char *argv[])
} /* while (1) */
if (optind < 0)
{
- FPRINTF (stderr,
+ fprintf (stderr,
"%s", "Unknown error parsing options\n");
free (print);
free (utf8_argv);
@@ -955,7 +955,7 @@ main (int argc, char *argv[])
}
if (utf8_argc - optind < 1)
{
- FPRINTF (stderr,
+ fprintf (stderr,
"%s", "Invoke with list of filenames to extract keywords
form!\n");
free (print);
free (utf8_argv);
@@ -980,15 +980,15 @@ main (int argc, char *argv[])
/* extract keywords */
if (YES == bibtex)
- FPRINTF (stdout,
+ fprintf (stdout,
"%s", _ ("% BiBTeX file\n"));
for (i = optind; i < utf8_argc; i++)
{
errno = 0;
if (YES == grepfriendly)
- FPRINTF (stdout, "%s ", utf8_argv[i]);
+ fprintf (stdout, "%s ", utf8_argv[i]);
else if (NO == bibtex)
- FPRINTF (stdout,
+ fprintf (stdout,
_ ("Keywords for file %s:\n"),
utf8_argv[i]);
else
@@ -1003,15 +1003,15 @@ main (int argc, char *argv[])
{
struct stat sb;
unsigned char *data = NULL;
- int f = OPEN (utf8_argv[i], O_RDONLY
+ int f = open (utf8_argv[i], O_RDONLY
#if WINDOWS
| O_BINARY
#endif
);
if ( (-1 != f) &&
- (0 == FSTAT (f, &sb)) &&
+ (0 == fstat (f, &sb)) &&
(NULL != (data = malloc ((size_t) sb.st_size))) &&
- (sb.st_size == READ (f, data, (size_t) sb.st_size) ) )
+ (sb.st_size == read (f, data, (size_t) sb.st_size) ) )
{
EXTRACTOR_extract (plugins,
NULL,
@@ -1022,7 +1022,7 @@ main (int argc, char *argv[])
else
{
if (verbose > 0)
- FPRINTF (stderr,
+ fprintf (stderr,
"%s: %s: %s\n",
utf8_argv[0], utf8_argv[i], strerror (errno));
ret = 1;
@@ -1030,18 +1030,18 @@ main (int argc, char *argv[])
if (NULL != data)
free (data);
if (-1 != f)
- (void) CLOSE (f);
+ (void) close (f);
}
if (YES == grepfriendly)
- FPRINTF (stdout, "%s", "\n");
+ fprintf (stdout, "%s", "\n");
continue;
}
if (YES == grepfriendly)
- FPRINTF (stdout, "%s", "\n");
+ fprintf (stdout, "%s", "\n");
if (bibtex)
finish_bibtex (utf8_argv[i]);
if (verbose > 0)
- FPRINTF (stdout, "%s", "\n");
+ fprintf (stdout, "%s", "\n");
free (print);
free (utf8_argv);
EXTRACTOR_plugin_remove_all (plugins);
diff --git a/src/main/extractor.c b/src/main/extractor.c
index 89d734d..defa229 100644
--- a/src/main/extractor.c
+++ b/src/main/extractor.c
@@ -19,7 +19,6 @@
*/
#include "platform.h"
-#include "plibc.h"
#include "extractor.h"
#include <dirent.h>
#include <sys/types.h>
@@ -670,7 +669,7 @@ EXTRACTOR_ltdl_init ()
int err;
#if ENABLE_NLS
- BINDTEXTDOMAIN (PACKAGE, LOCALEDIR);
+ bindtextdomain (PACKAGE, LOCALEDIR);
#endif
err = lt_dlinit ();
if (err > 0)
diff --git a/src/main/extractor_datasource.c b/src/main/extractor_datasource.c
index 0b18d7c..9f51d90 100644
--- a/src/main/extractor_datasource.c
+++ b/src/main/extractor_datasource.c
@@ -229,7 +229,7 @@ bfds_pick_next_buffer_at (struct BufferedFileDataSource
*bfds,
bfds->buffer_pos = pos;
return 0;
}
- position = (int64_t) LSEEK (bfds->fd, pos, SEEK_SET);
+ position = (int64_t) lseek (bfds->fd, pos, SEEK_SET);
if (position < 0)
{
LOG_STRERROR ("lseek");
@@ -1214,38 +1214,38 @@ EXTRACTOR_datasource_create_from_file_ (const char
*filename,
winmode = O_BINARY;
#endif
- if (-1 == (fd = OPEN (filename, O_RDONLY | O_LARGEFILE | winmode)))
+ if (-1 == (fd = open (filename, O_RDONLY | O_LARGEFILE | winmode)))
{
LOG_STRERROR_FILE ("open", filename);
return NULL;
}
- if ( (0 != FSTAT (fd, &sb)) ||
+ if ( (0 != fstat (fd, &sb)) ||
(S_ISDIR (sb.st_mode)) )
{
if (! S_ISDIR (sb.st_mode))
LOG_STRERROR_FILE ("fstat", filename);
else
LOG ("Skipping directory `%s'\n", filename);
- (void) CLOSE (fd);
+ (void) close (fd);
return NULL;
}
fsize = (int64_t) sb.st_size;
if (0 == fsize)
{
- (void) CLOSE (fd);
+ (void) close (fd);
return NULL;
}
bfds = bfds_new (NULL, fd, fsize);
if (NULL == bfds)
{
- (void) CLOSE (fd);
+ (void) close (fd);
return NULL;
}
if (NULL == (ds = malloc (sizeof (struct EXTRACTOR_Datasource))))
{
LOG_STRERROR ("malloc");
bfds_delete (bfds);
- (void) CLOSE (fd);
+ (void) close (fd);
return NULL;
}
ds->bfds = bfds;
@@ -1261,7 +1261,7 @@ EXTRACTOR_datasource_create_from_file_ (const char
*filename,
LOG ("Failed to initialize decompressor\n");
bfds_delete (bfds);
free (ds);
- (void) CLOSE (fd);
+ (void) close (fd);
return NULL;
}
}
@@ -1333,7 +1333,7 @@ EXTRACTOR_datasource_destroy_ (struct
EXTRACTOR_Datasource *ds)
cfs_destroy (ds->cfs);
bfds_delete (ds->bfds);
if (-1 != ds->fd)
- (void) CLOSE (ds->fd);
+ (void) close (ds->fd);
free (ds);
}
diff --git a/src/main/extractor_ipc_gnu.c b/src/main/extractor_ipc_gnu.c
index 06e4a1b..4bb5869 100644
--- a/src/main/extractor_ipc_gnu.c
+++ b/src/main/extractor_ipc_gnu.c
@@ -23,7 +23,6 @@
* @author Christian Grothoff
*/
#include "platform.h"
-#include "plibc.h"
#include "extractor.h"
#include "extractor_datasource.h"
#include "extractor_logging.h"
@@ -155,7 +154,7 @@ EXTRACTOR_IPC_shared_memory_create_ (size_t size)
"%sLE-%u-%u",
tpath,
getpid (),
- (unsigned int) RANDOM ());
+ (unsigned int) random ());
if (-1 == (shm->shm_id = shm_open (shm->shm_name,
O_RDWR | O_CREAT,
S_IRUSR | S_IWUSR)))
diff --git a/src/main/extractor_ipc_w32.c b/src/main/extractor_ipc_w32.c
index b53bc3c..8749da9 100644
--- a/src/main/extractor_ipc_w32.c
+++ b/src/main/extractor_ipc_w32.c
@@ -162,7 +162,7 @@ EXTRACTOR_IPC_shared_memory_create_ (size_t size)
snprintf (shm->shm_name, MAX_SHM_NAME,
"%slibextractor-shm-%u-%u",
tpath, getpid (),
- (unsigned int) RANDOM ());
+ (unsigned int) random ());
shm->map = CreateFileMapping (INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0,
size, shm->shm_name);
shm->ptr = MapViewOfFile (shm->map, FILE_MAP_WRITE, 0, 0, size);
diff --git a/src/main/extractor_plugin_main.c b/src/main/extractor_plugin_main.c
index ee51c8f..409290d 100644
--- a/src/main/extractor_plugin_main.c
+++ b/src/main/extractor_plugin_main.c
@@ -23,7 +23,6 @@
* @author Christian Grothoff
*/
#include "platform.h"
-#include "plibc.h"
#include "extractor.h"
#include "extractor_common.h"
#include "extractor_datasource.h"
diff --git a/src/main/extractor_plugins.h b/src/main/extractor_plugins.h
index 8b0f5e6..b362d43 100644
--- a/src/main/extractor_plugins.h
+++ b/src/main/extractor_plugins.h
@@ -26,7 +26,6 @@
#define EXTRACTOR_PLUGINS_H
#include "platform.h"
-#include "plibc.h"
#include "extractor.h"
#include <signal.h>
#include <ltdl.h>
diff --git a/src/main/extractor_plugpath.c b/src/main/extractor_plugpath.c
index 4374bc5..269061f 100644
--- a/src/main/extractor_plugpath.c
+++ b/src/main/extractor_plugpath.c
@@ -24,7 +24,6 @@
*/
#include "platform.h"
-#include "plibc.h"
#include "extractor.h"
#include <dirent.h>
#include <sys/types.h>
@@ -103,7 +102,7 @@ get_path_from_proc_exe ()
sizeof (fn),
"/proc/%u/maps",
getpid ());
- if (NULL != (f = FOPEN (fn, "r")))
+ if (NULL != (f = fopen (fn, "r")))
{
while (NULL != fgets (line, 1024, f))
{
@@ -419,7 +418,7 @@ append_to_dir (const char *path,
if (0 == (slen = strlen (path)))
return NULL;
- if (DIR_SEPARATOR == fname[0])
+ if ('/' == fname[0])
fname++;
ret = malloc (slen + strlen (fname) + 2);
if (NULL == ret)
@@ -476,9 +475,9 @@ get_installation_paths (EXTRACTOR_PathProcessor pp,
LOG_STRERROR ("strdup");
return;
}
- for (prefix = strtok_r (d, PATH_SEPARATOR_STR, &saveptr);
+ for (prefix = strtok_r (d, ":", &saveptr);
NULL != prefix;
- prefix = strtok_r (NULL, PATH_SEPARATOR_STR, &saveptr))
+ prefix = strtok_r (NULL, ":", &saveptr))
pp (pp_cls, prefix);
free (d);
return;
@@ -551,9 +550,9 @@ find_plugin_in_path (void *cls,
if (NULL != sc->path)
return;
- if (NULL == (dir = OPENDIR (path)))
+ if (NULL == (dir = opendir (path)))
return;
- while (NULL != (ent = READDIR (dir)))
+ while (NULL != (ent = readdir (dir)))
{
if ('.' == ent->d_name[0])
continue;
@@ -568,7 +567,7 @@ find_plugin_in_path (void *cls,
if (NULL == (sym = strdup (sym_name)))
{
LOG_STRERROR ("strdup");
- CLOSEDIR (dir);
+ closedir (dir);
return;
}
dot = strchr (sym, '.');
@@ -582,7 +581,7 @@ find_plugin_in_path (void *cls,
}
free (sym);
}
- CLOSEDIR (dir);
+ closedir (dir);
}
diff --git a/src/main/test_bzip2.c b/src/main/test_bzip2.c
index 598e913..1c4c9d3 100644
--- a/src/main/test_bzip2.c
+++ b/src/main/test_bzip2.c
@@ -135,7 +135,7 @@ main (int argc, char *argv[])
/* change environment to find 'extractor_test' plugin which is
not installed but should be in the current directory (or .libs)
on 'make check' */
- if (0 != putenv ("LIBEXTRACTOR_PREFIX=." PATH_SEPARATOR_STR ".libs/"))
+ if (0 != putenv ("LIBEXTRACTOR_PREFIX=.:.libs/"))
fprintf (stderr,
"Failed to update my environment, plugin loading may fail: %s\n",
strerror (errno));
diff --git a/src/main/test_file.c b/src/main/test_file.c
index a2d6a5e..83681f7 100644
--- a/src/main/test_file.c
+++ b/src/main/test_file.c
@@ -135,7 +135,7 @@ main (int argc, char *argv[])
/* change environment to find 'extractor_test' plugin which is
not installed but should be in the current directory (or .libs)
on 'make check' */
- if (0 != putenv ("LIBEXTRACTOR_PREFIX=." PATH_SEPARATOR_STR ".libs/"))
+ if (0 != putenv ("LIBEXTRACTOR_PREFIX=.:.libs/"))
fprintf (stderr,
"Failed to update my environment, plugin loading may fail: %s\n",
strerror (errno));
diff --git a/src/main/test_gzip.c b/src/main/test_gzip.c
index 071c74c..5b29ac1 100644
--- a/src/main/test_gzip.c
+++ b/src/main/test_gzip.c
@@ -139,7 +139,7 @@ main (int argc, char *argv[])
/* change environment to find 'extractor_test' plugin which is
not installed but should be in the current directory (or .libs)
on 'make check' */
- if (0 != putenv ("LIBEXTRACTOR_PREFIX=." PATH_SEPARATOR_STR ".libs/"))
+ if (0 != putenv ("LIBEXTRACTOR_PREFIX=.:.libs/"))
fprintf (stderr,
"Failed to update my environment, plugin loading may fail: %s\n",
strerror (errno));
diff --git a/src/main/test_ipc.c b/src/main/test_ipc.c
index 4da3ef5..1ef23f0 100644
--- a/src/main/test_ipc.c
+++ b/src/main/test_ipc.c
@@ -145,7 +145,7 @@ main (int argc, char *argv[])
/* change environment to find 'extractor_test' plugin which is
not installed but should be in the current directory (or .libs)
on 'make check' */
- if (0 != putenv ("LIBEXTRACTOR_PREFIX=." PATH_SEPARATOR_STR ".libs/"))
+ if (0 != putenv ("LIBEXTRACTOR_PREFIX=.:.libs/"))
fprintf (stderr,
"Failed to update my environment, plugin loading may fail: %s\n",
strerror (errno));
diff --git a/src/main/test_plugin_load_multi.c
b/src/main/test_plugin_load_multi.c
index 6b30390..18b3e64 100644
--- a/src/main/test_plugin_load_multi.c
+++ b/src/main/test_plugin_load_multi.c
@@ -60,7 +60,7 @@ main (int argc, char *argv[])
/* change environment to find 'extractor_test' plugin which is
not installed but should be in the current directory (or .libs)
on 'make check' */
- if (0 != putenv ("LIBEXTRACTOR_PREFIX=." PATH_SEPARATOR_STR ".libs/"))
+ if (0 != putenv ("LIBEXTRACTOR_PREFIX=.:.libs/"))
fprintf (stderr,
"Failed to update my environment, plugin loading may fail: %s\n",
strerror (errno));
diff --git a/src/main/test_plugin_loading.c b/src/main/test_plugin_loading.c
index 537b703..708c76c 100644
--- a/src/main/test_plugin_loading.c
+++ b/src/main/test_plugin_loading.c
@@ -33,7 +33,7 @@ main (int argc, char *argv[])
/* change environment to find 'extractor_test' plugin which is
not installed but should be in the current directory (or .libs)
on 'make check' */
- if (0 != putenv ("LIBEXTRACTOR_PREFIX=." PATH_SEPARATOR_STR ".libs/"))
+ if (0 != putenv ("LIBEXTRACTOR_PREFIX=.:.libs/"))
fprintf (stderr,
"Failed to update my environment, plugin loading may fail: %s\n",
strerror (errno));
diff --git a/src/main/test_trivial.c b/src/main/test_trivial.c
index b0860b4..ce0e7d5 100644
--- a/src/main/test_trivial.c
+++ b/src/main/test_trivial.c
@@ -51,7 +51,7 @@ main (int argc, char *argv[])
/* change environment to find 'extractor_test' plugin which is
not installed but should be in the current directory (or .libs)
on 'make check' */
- if (0 != putenv ("LIBEXTRACTOR_PREFIX=." PATH_SEPARATOR_STR ".libs/"))
+ if (0 != putenv ("LIBEXTRACTOR_PREFIX=.:.libs/"))
fprintf (stderr,
"Failed to update my environment, plugin loading may fail: %s\n",
strerror (errno));
diff --git a/src/plugins/fuzz_default.sh b/src/plugins/fuzz_default.sh
index c404723..7418dff 100755
--- a/src/plugins/fuzz_default.sh
+++ b/src/plugins/fuzz_default.sh
@@ -6,11 +6,11 @@ ZZSTARTSEED=0
ZZSTOPSEED=100
ret=0
# fallbacks for direct, non-"make check" usage
-if test x"$testdatadir" = x""
+if test x"${testdatadir:-NONE}" = xNONE""
then
testdatadir=../../test
fi
-if test x"$bindir" = x""
+if test x"${bindir:-NONE}" = xNONE""
then
bindir=`grep "^prefix = " ./Makefile | cut -d ' ' -f 3`
bindir="$bindir/bin"
diff --git a/src/plugins/gif_extractor.c b/src/plugins/gif_extractor.c
index 405eebe..3b202b5 100644
--- a/src/plugins/gif_extractor.c
+++ b/src/plugins/gif_extractor.c
@@ -36,7 +36,7 @@
* @return -1 on error, otherwise number of bytes read
*/
static int
-gif_read_func (GifFileType *ft,
+gif_READ_func (GifFileType *ft,
GifByteType *bt,
int arg)
{
@@ -68,13 +68,13 @@ EXTRACTOR_gif_extract_method (struct
EXTRACTOR_ExtractContext *ec)
int et;
char dims[128];
#if defined (GIF_LIB_VERSION) || GIFLIB_MAJOR <= 4
- if (NULL == (gif_file = DGifOpen (ec, &gif_read_func)))
+ if (NULL == (gif_file = DGifOpen (ec, &gif_READ_func)))
return; /* not a GIF */
#else
int gif_error;
gif_error = 0;
- gif_file = DGifOpen (ec, &gif_read_func, &gif_error);
+ gif_file = DGifOpen (ec, &gif_READ_func, &gif_error);
if ((gif_file == NULL) || (gif_error != 0))
{
if (gif_file != NULL)
diff --git a/src/plugins/old/ebml_extractor.c b/src/plugins/old/ebml_extractor.c
index f7daa9a..0d4fc91 100644
--- a/src/plugins/old/ebml_extractor.c
+++ b/src/plugins/old/ebml_extractor.c
@@ -734,7 +734,7 @@ struct ebml_state
int reported_ebml;
int valid_ebml;
uint64_t ebml_version;
- uint64_t ebml_read_version;
+ uint64_t ebml_READ_version;
uint64_t ebml_max_id_length;
uint64_t ebml_max_size_length;
char *doctype;
@@ -796,7 +796,7 @@ clean_ebml_state_ebml (struct ebml_state *state)
state->reported_ebml = 0;
state->valid_ebml = 0;
state->ebml_version = 1;
- state->ebml_read_version = 1;
+ state->ebml_READ_version = 1;
state->ebml_max_id_length = 4;
state->ebml_max_size_length = 8;
state->doctype = NULL;
@@ -1699,7 +1699,7 @@ EXTRACTOR_ebml_extract_method (struct
EXTRACTOR_PluginList *plugin,
state->ebml_version = uint_value;
break;
case EBMLID_READ_VERSION:
- state->ebml_read_version = uint_value;
+ state->ebml_READ_version = uint_value;
if (uint_value > 1)
{
/* We don't support EBML versions > 1 */
diff --git a/src/plugins/rpm_extractor.c b/src/plugins/rpm_extractor.c
index 90c5892..248217a 100644
--- a/src/plugins/rpm_extractor.c
+++ b/src/plugins/rpm_extractor.c
@@ -106,7 +106,7 @@ pipe_feeder (void *args)
while ( (0 == p->shutdown) &&
(done < rret) )
{
- if (-1 == (wret = WRITE (p->pi[1],
+ if (-1 == (wret = write (p->pi[1],
&buf[done],
rret - done)))
{
@@ -119,7 +119,7 @@ pipe_feeder (void *args)
if (done != rret)
break;
}
- CLOSE (p->pi[1]);
+ close (p->pi[1]);
return NULL;
}
@@ -272,8 +272,8 @@ EXTRACTOR_rpm_extract_method (struct
EXTRACTOR_ExtractContext *ec)
return;
if (0 != pthread_mutex_init (&parg.lock, NULL))
{
- CLOSE (parg.pi[0]);
- CLOSE (parg.pi[1]);
+ close (parg.pi[0]);
+ close (parg.pi[1]);
return;
}
if (0 != pthread_create (&pthr,
@@ -282,8 +282,8 @@ EXTRACTOR_rpm_extract_method (struct
EXTRACTOR_ExtractContext *ec)
&parg))
{
pthread_mutex_destroy (&parg.lock);
- CLOSE (parg.pi[0]);
- CLOSE (parg.pi[1]);
+ close (parg.pi[0]);
+ close (parg.pi[1]);
return;
}
rpmlogSetCallback (&discard_log_callback, NULL);
@@ -416,7 +416,7 @@ END:
sig.sa_handler = SIG_IGN;
sigaction (SIGALRM, &sig, &old);
parg.shutdown = 1;
- CLOSE (parg.pi[0]);
+ close (parg.pi[0]);
Fclose (fdi);
pthread_kill (pthr, SIGALRM);
pthread_join (pthr, &unused);
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.