]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Merge rev 1.91:
authorJulian Seward <jseward@acm.org>
Tue, 6 Aug 2002 09:06:18 +0000 (09:06 +0000)
committerJulian Seward <jseward@acm.org>
Tue, 6 Aug 2002 09:06:18 +0000 (09:06 +0000)
Simulate resolver-specific state as per the real libpthread.so, wherein
the root thread (tid 1) always uses _res as exported from libc.so as its
state.  This fixes the name lookup problems in KAtlantik.

git-svn-id: svn://svn.valgrind.org/valgrind/branches/VALGRIND_1_0_BRANCH@552

vg_libpthread.c

index 60c4dc95ff78a1236692c2f768c092fbf3b3aa11..994cdb74e0612d4d2f55fd59a147cd6f11d46df6 100644 (file)
@@ -1354,6 +1354,10 @@ int* __h_errno_location ( void )
    return & thread_specific_h_errno[tid];
 }
 
+
+#undef _res
+extern struct __res_state _res;
+
 struct __res_state* __res_state ( void )
 {
    int tid;
@@ -1364,6 +1368,8 @@ struct __res_state* __res_state ( void )
    /* 'cos I'm paranoid ... */
    if (tid < 1 || tid >= VG_N_THREADS)
       barf("__res_state: invalid ThreadId");
+   if (tid == 1)
+      return & _res;
    return & thread_specific_res_state[tid];
 }