~ubuntu-branches/ubuntu/intrepid/binkd/intrepid

« back to all changes in this revision

Viewing changes to binkd.c

  • Committer: Bazaar Package Importer
  • Author(s): Marco d'Itri
  • Date: 2006-08-25 19:50:50 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060825195050-ljt6glswfvxvsyjp
Tags: 0.9.9+20060809-1
* New upstream snapshot.
* I AM LOOKING FOR A CO-MAINTAINER!

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
 */
13
13
 
14
14
/*
15
 
 * $Id: binkd.c,v 2.30.2.9 2004/11/08 12:05:33 gul Exp $
 
15
 * $Id: binkd.c,v 2.30.2.11 2006/08/09 07:35:18 gul Exp $
16
16
 *
17
17
 * $Log: binkd.c,v $
 
18
 * Revision 2.30.2.11  2006/08/09 07:35:18  gul
 
19
 * Minor fix in binkd restart
 
20
 *
 
21
 * Revision 2.30.2.10  2005/11/07 18:56:28  stas
 
22
 * MFC: New option '-n', may be used to config check with option '-d' or to make poll with '-P'
 
23
 *
18
24
 * Revision 2.30.2.9  2004/11/08 12:05:33  gul
19
25
 * 0.9.8 release
20
26
 *
280
286
        AllocTempConsole();
281
287
#endif
282
288
 
283
 
  printf ("usage: binkd [-Ccpqrsvmh"
 
289
  printf ("usage: binkd [-nCcpqrsvmh"
284
290
#if defined(HAVE_DAEMON) || defined(HAVE_SETSID) || defined(HAVE_TIOCNOTTY)
285
291
          "D"
286
292
#endif
323
329
          "  -s       run server only\n"
324
330
          "  -v       be verbose / dump version and quit\n"
325
331
          "  -m       disable CRAM-MD5 authorization\n"
 
332
          "  -n       doing not call or listen (only check cfg and make polls)\n"
326
333
          "  -h       print this help\n"
327
334
          "\n"
328
335
          "Copyright (c) 1996-2004 Dima Maloff and others.\n"
356
363
int checkcfg_flag = 0;                 /* exit(3) on config change (-C) */
357
364
int no_MD5 = 0;                        /* disable MD5 flag (-m) */
358
365
int no_crypt = 0;                      /* disable CRYPT (-r) */
 
366
int no_flag = 0;                       /* do not run server and client */
359
367
 
360
368
#ifdef BINKDW9X
361
369
extern const char *Win9xStartService;  /* 'Run as win9x service' option */
466
474
            case 'r':
467
475
              no_crypt = 1;
468
476
              break;
 
477
            case 'n':
 
478
              no_flag = 1;
 
479
              break;
469
480
            case 'v':
470
481
              ++verbose_flag;
471
482
              break;
472
483
#ifdef BINKD_DAEMONIZE
473
484
            case 'D':
 
485
              if (daemon_flag) continue;
474
486
              daemon_flag = 1;
475
487
              /* remove this switch from saved_argv */
 
488
              if (argv[i][2])
 
489
                strcpy(saved_argv[i]+(s-argv[i]), saved_argv[i]+(s-argv[i])+1);
 
490
              else
476
491
              { int j;
477
492
                free(saved_argv[i]);
478
493
                for (j=i; j<argc; j++)
616
631
  }
617
632
#endif
618
633
 
 
634
  if (no_flag)
 
635
  {
 
636
    Log(0, "Exit on option '-n'");
 
637
  }
 
638
 
619
639
#ifdef BINKD_DAEMONIZE
620
640
  if (daemon_flag)
621
641
  {
662
682
    exitfunc();
663
683
    print_args (tmp, sizeof (tmp), saved_argc - 1, saved_argv + 1);
664
684
    Log (2, "exec %s%s", saved_argv[0], tmp);
665
 
    if (execv (saved_argv[0], saved_argv) == -1)
666
 
      Log (1, "execv: %s", strerror (errno));
 
685
    if (execvp (saved_argv[0], saved_argv) == -1)
 
686
      Log (1, "execvp: %s", strerror (errno));
667
687
  }
668
688
  else
669
689
  {