[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: patch to fix sense of "file not found" check in ltdl.c
From: |
Bob Friesenhahn |
Subject: |
Re: patch to fix sense of "file not found" check in ltdl.c |
Date: |
Thu, 24 Oct 2002 16:29:13 -0500 (CDT) |
This patch is applied to CVS head.
Bob
On Thu, 24 Oct 2002, Ossama Othman wrote:
> Hi,
>
> >From a Debian user about some code in `ltdl.c':
>
> --------------------------------------------------
> /* If we found FILENAME, stop searching -- whether we were able to
> load the file as a module or not. If the file exists but loading
> failed, it is better to return an error message here than to
> report FILE_NOT_FOUND when the alternatives (foo.so etc) are not
> in the module search path. */
> if (handle || ((errors > 0) && file_not_found ()))
> {
> LT_DLFREE (tmp);
> return handle;
> }
>
> Here the comment and the code disagree (and the comment is
> right). This code says "Return with what we have if (we have a valid
> handle) or (we have a "file not found" error), when it should have
> been (we do *NOT* have a "file not found" error).
> --------------------------------------------------
>
> And the accompanying patch against libtool HEAD:
>
>
> Index: ChangeLog
> ===================================================================
> RCS file: /cvs/libtool/ChangeLog,v
> retrieving revision 1.1140
> diff -u -u -5 -r1.1140 ChangeLog
> --- ChangeLog 24 Oct 2002 03:42:53 -0000 1.1140
> +++ ChangeLog 24 Oct 2002 21:18:11 -0000
> @@ -1,5 +1,11 @@
> +2002-10-24 Ossama Othman <address@hidden>
> +
> + From Andrew Suffield <address@hidden>
> + * libltdl/ltdl.c (lt_dlopenext): Corrected sense of "file not
> + found" check.
> +
> 2002-10-23 Bob Friesenhahn <address@hidden>
>
> * Removed old Windows cruft.
> * Adapted pw32 to be like Cygwin/MinGW.
>
> Index: libltdl/ltdl.c
> ===================================================================
> RCS file: /cvs/libtool/libltdl/ltdl.c,v
> retrieving revision 1.170
> diff -u -u -5 -r1.170 ltdl.c
> --- libltdl/ltdl.c 24 Sep 2002 14:06:50 -0000 1.170
> +++ libltdl/ltdl.c 24 Oct 2002 21:18:11 -0000
> @@ -3116,11 +3116,11 @@
> /* If we found FILENAME, stop searching -- whether we were able to
> load the file as a module or not. If the file exists but loading
> failed, it is better to return an error message here than to
> report FILE_NOT_FOUND when the alternatives (foo.so etc) are not
> in the module search path. */
> - if (handle || ((errors > 0) && file_not_found ()))
> + if (handle || ((errors > 0) && !file_not_found ()))
> {
> LT_DLFREE (tmp);
> return handle;
> }
>
> @@ -3143,11 +3143,11 @@
> strcat(tmp, shlib_ext);
> errors = try_dlopen (&handle, tmp);
>
> /* As before, if the file was found but loading failed, return now
> with the current error message. */
> - if (handle || ((errors > 0) && file_not_found ()))
> + if (handle || ((errors > 0) && !file_not_found ()))
> {
> LT_DLFREE (tmp);
> return handle;
> }
> #endif
>
>
>
> -Ossama
> --
> Ossama Othman <address@hidden>
> Distributed Object Computing Laboratory, Univ. of California at Irvine
> 1024D/F7A394A8 - 84ED AA0B 1203 99E4 1068 70E6 5EB7 5E71 F7A3 94A8
>
>
> _______________________________________________
> Libtool-patches mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/libtool-patches
>
======================================
Bob Friesenhahn
address@hidden
http://www.simplesystems.org/users/bfriesen