Reverted last commit since it does not fix anything (unfortunately).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7997 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/exp-drd/drd_pthread_intercepts.c b/exp-drd/drd_pthread_intercepts.c
index f64ab1c..5b28d67 100644
--- a/exp-drd/drd_pthread_intercepts.c
+++ b/exp-drd/drd_pthread_intercepts.c
@@ -97,6 +97,7 @@
 static void init(void)
 {
   check_threading_library();
+  vg_set_main_thread_state();
   /* glibc up to and including version 2.7 triggers conflicting accesses   */
   /* on stdout and stderr when sending output to one of these streams from */
   /* more than one thread. Suppress data race reports on these objects.    */
@@ -104,17 +105,6 @@
   DRD_IGNORE_VAR(*stderr);
 }
 
-int VG_WRAP_FUNCTION_ZZ(Za,main)(int argc, char** argv, char** envp);
-int VG_WRAP_FUNCTION_ZZ(Za,main)(int argc, char** argv, char** envp)
-{
-  int ret;
-  OrigFn fn;
-  VALGRIND_GET_ORIG_FN(fn);
-  vg_set_main_thread_state();
-  CALL_FN_W_WWW(ret, fn, argc, argv, envp);
-  return ret;
-}
-
 static MutexT pthread_to_drd_mutex_type(const int kind)
 {
   switch (kind)