summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2018-10-22 01:59:09 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2018-10-22 01:59:09 +0000
commite3362544a863cc75f613fb72065ba42ed400f7f2 (patch)
tree5da56714e3c8cb19c25e9db2cb714170948a240c /libexec
parenta18af4635133547dcccc8b92decc3c585198c190 (diff)
Use int, not char*, for booleans
ok millert@
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ld.so/dlfcn.c4
-rw-r--r--libexec/ld.so/loader.c22
-rw-r--r--libexec/ld.so/resolve.c4
-rw-r--r--libexec/ld.so/resolve.h9
4 files changed, 20 insertions, 19 deletions
diff --git a/libexec/ld.so/dlfcn.c b/libexec/ld.so/dlfcn.c
index d6498bfac15..016e6316cc8 100644
--- a/libexec/ld.so/dlfcn.c
+++ b/libexec/ld.so/dlfcn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dlfcn.c,v 1.101 2018/02/04 20:41:58 deraadt Exp $ */
+/* $OpenBSD: dlfcn.c,v 1.102 2018/10/22 01:59:08 guenther Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -63,7 +63,7 @@ dlopen(const char *libname, int flags)
return RTLD_DEFAULT;
if ((flags & RTLD_TRACE) == RTLD_TRACE) {
- _dl_traceld = "true";
+ _dl_traceld = 1;
_dl_tracelib = 1;
}
diff --git a/libexec/ld.so/loader.c b/libexec/ld.so/loader.c
index 0bc2a4139d7..8cb3f645162 100644
--- a/libexec/ld.so/loader.c
+++ b/libexec/ld.so/loader.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: loader.c,v 1.172 2017/12/08 05:25:20 deraadt Exp $ */
+/* $OpenBSD: loader.c,v 1.173 2018/10/22 01:59:08 guenther Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -56,14 +56,14 @@ void _dl_fixup_user_env(void);
void _dl_call_preinit(elf_object_t *);
void _dl_call_init_recurse(elf_object_t *object, int initfirst);
-int _dl_pagesz;
+int _dl_pagesz;
+int _dl_bindnow;
+int _dl_traceld;
+int _dl_debug;
char **_dl_libpath;
char *_dl_preload;
-char *_dl_bindnow;
-char *_dl_traceld;
-char *_dl_debug;
char *_dl_showmap;
char *_dl_tracefmt1, *_dl_tracefmt2, *_dl_traceprog;
@@ -218,11 +218,11 @@ _dl_setup_env(const char *argv0, char **envp)
/*
* Get paths to various things we are going to use.
*/
- _dl_debug = _dl_getenv("LD_DEBUG", envp);
+ _dl_debug = _dl_getenv("LD_DEBUG", envp) != NULL;
_dl_libpath = _dl_split_path(_dl_getenv("LD_LIBRARY_PATH", envp));
_dl_preload = _dl_getenv("LD_PRELOAD", envp);
- _dl_bindnow = _dl_getenv("LD_BIND_NOW", envp);
- _dl_traceld = _dl_getenv("LD_TRACE_LOADED_OBJECTS", envp);
+ _dl_bindnow = _dl_getenv("LD_BIND_NOW", envp) != NULL;
+ _dl_traceld = _dl_getenv("LD_TRACE_LOADED_OBJECTS", envp) != NULL;
_dl_tracefmt1 = _dl_getenv("LD_TRACE_LOADED_OBJECTS_FMT1", envp);
_dl_tracefmt2 = _dl_getenv("LD_TRACE_LOADED_OBJECTS_FMT2", envp);
_dl_traceprog = _dl_getenv("LD_TRACE_LOADED_OBJECTS_PROGNAME", envp);
@@ -243,11 +243,11 @@ _dl_setup_env(const char *argv0, char **envp)
_dl_unsetenv("LD_PRELOAD", envp);
}
if (_dl_bindnow) {
- _dl_bindnow = NULL;
+ _dl_bindnow = 0;
_dl_unsetenv("LD_BIND_NOW", envp);
}
if (_dl_debug) {
- _dl_debug = NULL;
+ _dl_debug = 0;
_dl_unsetenv("LD_DEBUG", envp);
}
}
@@ -566,7 +566,7 @@ _dl_boot(const char **argv, char **envp, const long dyn_loff, long *dl_data)
*/
failed = 0;
- if (_dl_traceld == NULL)
+ if (!_dl_traceld)
failed = _dl_rtld(_dl_objects);
if (_dl_debug || _dl_traceld) {
diff --git a/libexec/ld.so/resolve.c b/libexec/ld.so/resolve.c
index d41181ba209..e5d676adccc 100644
--- a/libexec/ld.so/resolve.c
+++ b/libexec/ld.so/resolve.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: resolve.c,v 1.82 2018/03/09 14:55:44 kettenis Exp $ */
+/* $OpenBSD: resolve.c,v 1.83 2018/10/22 01:59:08 guenther Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -307,7 +307,7 @@ _dl_finalize_object(const char *objname, Elf_Dyn *dynp, Elf_Phdr *phdrp,
if ((object->obj_flags & DF_1_NOOPEN) != 0 &&
_dl_loading_object->obj_type == OBJTYPE_DLO &&
- _dl_traceld == NULL) {
+ !_dl_traceld) {
_dl_free(object);
_dl_errno = DL_CANT_LOAD_OBJ;
return(NULL);
diff --git a/libexec/ld.so/resolve.h b/libexec/ld.so/resolve.h
index d4512636291..392caeb558c 100644
--- a/libexec/ld.so/resolve.h
+++ b/libexec/ld.so/resolve.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: resolve.h,v 1.83 2017/05/08 02:34:01 guenther Exp $ */
+/* $OpenBSD: resolve.h,v 1.84 2018/10/22 01:59:08 guenther Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -288,13 +288,14 @@ extern int _dl_errno;
extern char **_dl_libpath;
+extern int _dl_bindnow;
+extern int _dl_traceld;
+extern int _dl_debug;
+
extern char *_dl_preload;
-extern char *_dl_bindnow;
-extern char *_dl_traceld;
extern char *_dl_tracefmt1;
extern char *_dl_tracefmt2;
extern char *_dl_traceprog;
-extern char *_dl_debug;
extern int _dl_trust;