We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2519 - In SDL_egl.c reports a wrong SDL_Error when the fallback path is used
Summary: In SDL_egl.c reports a wrong SDL_Error when the fallback path is used
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: HG 2.1
Hardware: x86_64 Linux
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-02 06:43 UTC by Sylvain
Modified: 2014-05-10 19:14 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sylvain 2014-05-02 06:43:03 UTC
Hi,

This is a minor/typo report.. But it's annoying and leads me to wrong debugging in my case.

When there is no "eglChooseConfig" in the shared object, the SDL_LoadFunction sets an "error" about "missing eglChooseConfig".
And we try the "DEFAULT_EGL" path that may success afterward.
But we keep the previous error which is now unrelevant !

I think we should use "SDL_ClearError()" when trying the default path.

Thanks,

Sylvain

file "src/video/SDL_egl.c", line "186" : 


    /* Try loading a EGL symbol, if it does not work try the default library paths */
    if (SDL_LoadFunction(dll_handle, "eglChooseConfig") == NULL) {             // this function sets an error

    /// SDL_ClearError();   // <<<<<<<< We are trying again, clear the error.

        if (dll_handle != NULL) {
            SDL_UnloadObject(dll_handle);
        }
        path = SDL_getenv("SDL_VIDEO_EGL_DRIVER");
        if (path == NULL) {
            path = DEFAULT_EGL;
        }
        dll_handle = SDL_LoadObject(path);
        if (dll_handle == NULL) {
            return SDL_SetError("Could not load EGL library");
        }
    }
Comment 1 Gabriel Jacobo 2014-05-10 19:14:01 UTC
Fixed here: https://hg.libsdl.org/SDL/rev/a8ef3ac69e3d

Thanks!