diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2000-09-15 07:13:52 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2000-09-15 07:13:52 +0000 |
commit | 42a3e69c05af72afbc1d37574fba7729b828289b (patch) | |
tree | becf08be7a11e201542de4de93b8cd0f8650f9e1 /gnu/libexec | |
parent | b74ef7bac5077f29fc1c12e8b5ccaf0e2f1f8fdc (diff) |
check return value for setenv(3) for failure, and deal appropriately
Diffstat (limited to 'gnu/libexec')
-rw-r--r-- | gnu/libexec/ld.so/ldd/ldd.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gnu/libexec/ld.so/ldd/ldd.c b/gnu/libexec/ld.so/ldd/ldd.c index 6cb11b2b6a3..78a37bc75c1 100644 --- a/gnu/libexec/ld.so/ldd/ldd.c +++ b/gnu/libexec/ld.so/ldd/ldd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldd.c,v 1.2 1998/01/28 10:52:45 pefo Exp $ */ +/* $OpenBSD: ldd.c,v 1.3 2000/09/15 07:13:44 deraadt Exp $ */ /* * Copyright (c) 1996 Per Fogelstrom @@ -77,7 +77,12 @@ main(argc, argv) else if(lflag && readsoneeded(f, 1)) { fclose(f); - setenv("LD_TRACE_LOADED_OBJECTS", "1", 1); + if (setenv("LD_TRACE_LOADED_OBJECTS", "1", 1) == -1) { + fprintf(stderr, + "%s: can't setenv LD_TRACE_LOADED_OBJECTS\n", + argv[0]); + exit(2); + } execl(argv[i], NULL); } exit(0); |