comparison pidgin/gtkmain.c @ 18135:5114739a4169

Allow disabling check for single instance.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sun, 17 Jun 2007 00:08:13 +0000
parents 59aec2d6ec43
children 00cec200ec58
comparison
equal deleted inserted replaced
18134:9b2cd6920475 18135:5114739a4169
429 { 429 {
430 gboolean opt_help = FALSE; 430 gboolean opt_help = FALSE;
431 gboolean opt_login = FALSE; 431 gboolean opt_login = FALSE;
432 gboolean opt_nologin = FALSE; 432 gboolean opt_nologin = FALSE;
433 gboolean opt_version = FALSE; 433 gboolean opt_version = FALSE;
434 gboolean opt_si = TRUE; /* Check for single instance? */
434 char *opt_config_dir_arg = NULL; 435 char *opt_config_dir_arg = NULL;
435 char *opt_login_arg = NULL; 436 char *opt_login_arg = NULL;
436 char *opt_session_arg = NULL; 437 char *opt_session_arg = NULL;
437 char *search_path; 438 char *search_path;
438 GList *accounts; 439 GList *accounts;
568 569
569 /* scan command-line options */ 570 /* scan command-line options */
570 opterr = 1; 571 opterr = 1;
571 while ((opt = getopt_long(argc, argv, 572 while ((opt = getopt_long(argc, argv,
572 #ifndef _WIN32 573 #ifndef _WIN32
573 "c:dhnl::s:v", 574 "c:dhmnl::s:v",
574 #else 575 #else
575 "c:dhnl::v", 576 "c:dhnl::v",
576 #endif 577 #endif
577 long_options, NULL)) != -1) { 578 long_options, NULL)) != -1) {
578 switch (opt) { 579 switch (opt) {
600 opt_session_arg = g_strdup(optarg); 601 opt_session_arg = g_strdup(optarg);
601 break; 602 break;
602 case 'v': /* version */ 603 case 'v': /* version */
603 opt_version = TRUE; 604 opt_version = TRUE;
604 break; 605 break;
606 case 'm': /* do not ensure single instance. */
607 opt_si = FALSE;
608 break;
605 case '?': /* show terse help */ 609 case '?': /* show terse help */
606 default: 610 default:
607 show_usage(argv[0], TRUE); 611 show_usage(argv[0], TRUE);
608 #ifdef HAVE_SIGNAL_H 612 #ifdef HAVE_SIGNAL_H
609 g_free(segfault_message); 613 g_free(segfault_message);
726 g_free(segfault_message); 730 g_free(segfault_message);
727 #endif 731 #endif
728 abort(); 732 abort();
729 } 733 }
730 734
731 if (!purple_core_ensure_single_instance()) { 735 if (opt_si && !purple_core_ensure_single_instance()) {
732 purple_core_quit(); 736 purple_core_quit();
733 #ifdef HAVE_SIGNAL_H 737 #ifdef HAVE_SIGNAL_H
734 g_free(segfault_message); 738 g_free(segfault_message);
735 #endif 739 #endif
736 return 0; 740 return 0;