comparison src/proxy.c @ 5435:a2f26666de42

[gaim-migrate @ 5817] Phroggie says windows doesn't have a z modifier, so I'm just going to change size_t to an int, since it really doesn't matter. I also changed some sprintf's to snprintf's, I'm not really sure why. Changed a printf to gaim_debug in oscar.c, I don't know how that got in there. And I applied a patch that adds an optional callback thing for when a connection is closed. Gaim doesn't use it, but the guy that submitted the patch said it was useful to him. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 18 May 2003 19:13:21 +0000
parents 8d8bf0d31a23
children 6f35b80c5ffa
comparison
equal deleted inserted replaced
5434:3034e83c1a49 5435:a2f26666de42
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",