[Midnightbsd-cvs] src [11125] trunk/sbin/ldconfig/ldconfig.c: sync with freebsd
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Tue Jun 19 15:36:39 EDT 2018
Revision: 11125
http://svnweb.midnightbsd.org/src/?rev=11125
Author: laffer1
Date: 2018-06-19 15:36:38 -0400 (Tue, 19 Jun 2018)
Log Message:
-----------
sync with freebsd
Modified Paths:
--------------
trunk/sbin/ldconfig/Makefile
trunk/sbin/ldconfig/elfhints.c
trunk/sbin/ldconfig/ldconfig.8
trunk/sbin/ldconfig/ldconfig.c
Property Changed:
----------------
trunk/sbin/ldconfig/ldconfig.8
Modified: trunk/sbin/ldconfig/Makefile
===================================================================
--- trunk/sbin/ldconfig/Makefile 2018-06-19 19:35:44 UTC (rev 11124)
+++ trunk/sbin/ldconfig/Makefile 2018-06-19 19:36:38 UTC (rev 11125)
@@ -1,5 +1,5 @@
-# $MidnightBSD: src/sbin/ldconfig/Makefile,v 1.2 2008/11/11 22:53:47 laffer1 Exp $
-# $FreeBSD: src/sbin/ldconfig/Makefile,v 1.20 2005/01/14 12:22:57 delphij Exp $
+# $MidnightBSD$
+# $FreeBSD: stable/10/sbin/ldconfig/Makefile 198236 2009-10-19 16:00:24Z ru $
PROG= ldconfig
SRCS= elfhints.c ldconfig.c shlib.c support.c
Modified: trunk/sbin/ldconfig/elfhints.c
===================================================================
--- trunk/sbin/ldconfig/elfhints.c 2018-06-19 19:35:44 UTC (rev 11124)
+++ trunk/sbin/ldconfig/elfhints.c 2018-06-19 19:36:38 UTC (rev 11125)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1998 John D. Polstra
* All rights reserved.
@@ -23,8 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $MidnightBSD$
- * $FreeBSD: src/sbin/ldconfig/elfhints.c,v 1.8 2001/05/02 23:56:18 obrien Exp $
+ * $FreeBSD: stable/10/sbin/ldconfig/elfhints.c 76224 2001-05-02 23:56:21Z obrien $
*/
#include <sys/param.h>
Modified: trunk/sbin/ldconfig/ldconfig.8
===================================================================
--- trunk/sbin/ldconfig/ldconfig.8 2018-06-19 19:35:44 UTC (rev 11124)
+++ trunk/sbin/ldconfig/ldconfig.8 2018-06-19 19:36:38 UTC (rev 11125)
@@ -1,3 +1,4 @@
+.\" $MidnightBSD$
.\"
.\" Copyright (c) 1993 Paul Kranenburg
.\" All rights reserved.
@@ -27,9 +28,9 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/sbin/ldconfig/ldconfig.8,v 1.36 2005/12/09 03:12:25 obrien Exp $
+.\" $FreeBSD: stable/10/sbin/ldconfig/ldconfig.8 248496 2013-03-19 12:35:33Z joel $
.\"
-.Dd November 11, 2005
+.Dd March 19, 2013
.Dt LDCONFIG 8
.Os
.Sh NAME
@@ -162,21 +163,6 @@
addition to building a set of hints for quick lookup, it also serves to
specify the trusted collection of directories from which shared objects can
be safely loaded.
-.Sh ENVIRONMENT
-.Bl -tag -width OBJFORMATxxx -compact
-.It Ev OBJFORMAT
-Overrides
-.Pa /etc/objformat
-(see below) to determine whether
-.Fl aout
-or
-.Fl elf
-is the default.
-If set, its value should be either
-.Ql aout
-or
-.Ql elf .
-.El
.Sh FILES
.Bl -tag -width /var/run/ld-elf.so.hintsxxx -compact
.It Pa /var/run/ld.so.hints
@@ -196,17 +182,6 @@
Conventional configuration files containing directory names for
invocations with
.Fl 32 .
-.It Pa /etc/objformat
-Determines whether
-.Fl aout
-or
-.Fl elf
-is the default.
-If present, it must consist of a single line
-containing either
-.Ql OBJFORMAT=aout
-or
-.Ql OBJFORMAT=elf .
.El
.Sh SEE ALSO
.Xr ld 1 ,
Property changes on: trunk/sbin/ldconfig/ldconfig.8
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sbin/ldconfig/ldconfig.c
===================================================================
--- trunk/sbin/ldconfig/ldconfig.c 2018-06-19 19:35:44 UTC (rev 11124)
+++ trunk/sbin/ldconfig/ldconfig.c 2018-06-19 19:36:38 UTC (rev 11125)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*
* Copyright (c) 1993,1995 Paul Kranenburg
* All rights reserved.
@@ -30,7 +31,7 @@
#ifndef lint
static const char rcsid[] =
- "$FreeBSD: src/sbin/ldconfig/ldconfig.c,v 1.45.2.1 2005/11/18 19:47:41 jhb Exp $";
+ "$FreeBSD: stable/10/sbin/ldconfig/ldconfig.c 248525 2013-03-19 16:57:04Z imp $";
#endif /* not lint */
#include <sys/param.h>
@@ -97,6 +98,13 @@
static int readhints(void);
static void usage(void);
+/*
+ * Note on aout/a.out support.
+ * To properly support shared libraries for compat2x, which are a.out, we need
+ * to support a.out here. As of 2013, bug reports are still coming in for this
+ * feature (on amd64 no less), so we know it is still in use.
+ */
+
int
main(int argc, char **argv)
{
@@ -444,7 +452,7 @@
}
if (j == hdr.hh_nbucket) {
warnx("bummer!");
- goto out;
+ return -1;
}
while (bp->hi_next != -1)
bp = &blist[bp->hi_next];
@@ -479,7 +487,7 @@
umask(0); /* Create with exact permissions */
if ((fd = mkstemp(tmpfilename)) == -1) {
warn("%s", tmpfilename);
- goto out;
+ return -1;
}
fchmod(fd, 0444);
@@ -486,41 +494,34 @@
if (write(fd, &hdr, sizeof(struct hints_header)) !=
sizeof(struct hints_header)) {
warn("%s", hints_file);
- goto out;
+ return -1;
}
if (write(fd, blist, hdr.hh_nbucket * sizeof(*blist)) !=
(ssize_t)(hdr.hh_nbucket * sizeof(*blist))) {
warn("%s", hints_file);
- goto out;
+ return -1;
}
if (write(fd, strtab, strtab_sz) != strtab_sz) {
warn("%s", hints_file);
- goto out;
+ return -1;
}
if (close(fd) != 0) {
warn("%s", hints_file);
- goto out;
+ return -1;
}
/* Install it */
if (unlink(hints_file) != 0 && errno != ENOENT) {
warn("%s", hints_file);
- goto out;
+ return -1;
}
if (rename(tmpfilename, hints_file) != 0) {
warn("%s", hints_file);
- goto out;
+ return -1;
}
- free(blist);
- free(strtab);
return 0;
-
-out:
- free(blist);
- free(strtab);
- return -1;
}
static int
More information about the Midnightbsd-cvs
mailing list