[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: user/2158: ld fails when run from modload



The following reply was made to PR user/2158; it has been noted by GNATS.

From: Darren Reed <darrenr@reed.wattle.id.au>
To: deraadt@cvs.openbsd.org (Theo de Raadt)
Cc: art@blahonga.org, Todd.Miller@courtesan.com, gnats@openbsd.org
Subject: Re: user/2158: ld fails when run from modload
Date: Sun, 4 Nov 2001 15:53:40 +1100 (EST)

 Unfortunately I don't have the full source distribution for OpenBSD
 installed so I can't easily test this patch.  From my observations
 elsewhere, others seem to have made the same changes.
 
 In some email I received from Theo de Raadt, sie wrote:
 > Index: ld.c
 > ===================================================================
 > RCS file: /cvs/src/gnu/usr.bin/ld/ld.c,v
 > retrieving revision 1.18
 > diff -u -r1.18 ld.c
 > --- ld.c	8 Jul 2001 17:49:44 -0000	1.18
 > +++ ld.c	30 Oct 2001 16:42:02 -0000
 > @@ -1039,7 +1039,7 @@
 >  	} else
 >  		fd = open(entry->filename, O_RDONLY, 0);
 >  
 > -	if (fd > 0) {
 > +	if (fd >= 0) {
 >  		input_file = entry;
 >  		input_desc = fd;
 >  		return fd;
 > Index: lib.c
 > ===================================================================
 > RCS file: /cvs/src/gnu/usr.bin/ld/lib.c,v
 > retrieving revision 1.3
 > diff -u -r1.3 lib.c
 > --- lib.c	30 Aug 2001 10:42:01 -0000	1.3
 > +++ lib.c	30 Oct 2001 16:41:39 -0000
 > @@ -817,7 +817,7 @@
 >  
 >  	fname = findshlib(p->filename, &major, &minor, 1);
 >  
 > -	if (fname && (fd = open(fname, O_RDONLY, 0)) > 0) {
 > +	if (fname && (fd = open(fname, O_RDONLY, 0)) >= 0) {
 >  		p->filename = fname;
 >  		p->lib_major = major;
 >  		p->lib_minor = minor;
 > @@ -839,7 +839,7 @@
 >  		register char *path
 >  			= concat(search_dirs[i], "/", fname);
 >  		fd = open(path, O_RDONLY, 0);
 > -		if (fd > 0) {
 > +		if (fd >= 0) {
 >  			p->filename = path;
 >  			p->flags &= ~E_SEARCH_DIRS;
 >  			break;
 > 
 >