View | Details | Raw Unified | Return to issue 16193
Collapse All | Expand All

(-)cws_srx645_ooo11rc_unchanged/setup2/mow/source/loader/loader.c (-1 / +24 lines)
Lines 853-859 Link Here
853
    void *handle;
853
    void *handle;
854
    void * (*pverfunc)(void);
854
    void * (*pverfunc)(void);
855
    char *pvstr;
855
    char *pvstr;
856
	 int maj_ver;
857
	 int min_ver;
858
	 int mic_ver;
859
	 char *pos;
856
860
861
    maj_ver = min_ver = mic_ver = 0;
862
	 
857
    handle      = dlopen("libc.so.6", RTLD_LAZY);
863
    handle      = dlopen("libc.so.6", RTLD_LAZY);
858
864
859
    /* new API for glibc-2.1, not available in glibc-2.0.7 */
865
    /* new API for glibc-2.1, not available in glibc-2.0.7 */
Lines 862-869 Link Here
862
    if ( pverfunc ) {
868
    if ( pverfunc ) {
863
        pvstr = pverfunc();
869
        pvstr = pverfunc();
864
        printf("glibc version: %s\n", pvstr);
870
        printf("glibc version: %s\n", pvstr);
865
        if ( strncmp( "2.2", pvstr, 3 ) <= 0 )
871
        pos = pvstr;
872
        if (NULL != pos) {
873
            maj_ver = atoi(pos);
874
				
875
            pos = strchr (pos, '.');
876
            if ((NULL != pos) && (strlen (pos) > 1)) {
877
                min_ver = atoi (++pos);
878
879
                pos = strchr (pos, '.');
880
                if ((NULL != pos) && (strlen (pos) > 1))
881
                    mic_ver = atoi (++pos);
882
            }
883
        }
884
        dlclose (handle);
885
		  
886
        if ((maj_ver > 2) || ((maj_ver == 2) && (min_ver >= 2)))
866
            return;
887
            return;
888
    } else {
889
        dlclose (handle);
867
    }
890
    }
868
891
869
    printf("error: wrong glibc version, you need at least 2.2.0\n" );
892
    printf("error: wrong glibc version, you need at least 2.2.0\n" );

Return to issue 16193