src/proxy.c

changeset 5435
990c340ecb6d
parent 5426
b9b571cd1e57
child 5532
3ed50db32fe9
equal deleted inserted replaced
5434:82da098aca4c 5435:990c340ecb6d
331 331
332 static void trap_gdb_bug() 332 static void trap_gdb_bug()
333 { 333 {
334 const char *message = 334 const char *message =
335 "Gaim's DNS child got a SIGTRAP signal. \n" 335 "Gaim's DNS child got a SIGTRAP signal. \n"
336 "This can be caused by trying to run gaim into gdb.\n" 336 "This can be caused by trying to run gaim inside gdb.\n"
337 "There's a known gdb bug which prevent this, supposedly gaim\n" 337 "There is a known gdb bug which prevents this. Supposedly gaim\n"
338 "should have detected you were using gdb and use an ugly hack,\n" 338 "should have detected you were using gdb and used an ugly hack,\n"
339 "check cope_with_gdb_brokenness() in proxy.c.\n\n" 339 "check cope_with_gdb_brokenness() in proxy.c.\n\n"
340 "For more info about the bug check http://sources.redhat.com/ml/gdb/2001-07/msg00349.html\n"; 340 "For more info about this bug, see http://sources.redhat.com/ml/gdb/2001-07/msg00349.html\n";
341 fputs("\n* * *\n",stderr); 341 fputs("\n* * *\n",stderr);
342 fputs(message,stderr); 342 fputs(message,stderr);
343 fputs("* * *\n\n",stderr); 343 fputs("* * *\n\n",stderr);
344 execlp("xmessage","xmessage","-center", message, NULL); 344 execlp("xmessage","xmessage","-center", message, NULL);
345 _exit(1); 345 _exit(1);
355 #ifdef __linux__ 355 #ifdef __linux__
356 if(already_done) 356 if(already_done)
357 return; 357 return;
358 already_done = TRUE; 358 already_done = TRUE;
359 ppid = getppid(); 359 ppid = getppid();
360 sprintf(s,"/proc/%d/exe", ppid); 360 snprintf(s, 300, "/proc/%d/exe", ppid);
361 n = readlink(s, e, sizeof(e)); 361 n = readlink(s, e, sizeof(e));
362 e[MAX(n,sizeof(e)-1)] = '\0'; 362 e[MAX(n,sizeof(e)-1)] = '\0';
363 363
364 if(strstr(e,"gdb")) { 364 if(strstr(e,"gdb")) {
365 gaim_debug(GAIM_DEBUG_INFO, "dns", 365 gaim_debug(GAIM_DEBUG_INFO, "dns",

mercurial