Browse Source

another improvement in calling cleanup under some conditions

git-svn-id: svn+ssh://jackaudio.org/trunk/jack@73 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.109.0
pbd 24 years ago
parent
commit
c324d001c4
2 changed files with 10 additions and 7 deletions
  1. +1
    -1
      configure.in
  2. +9
    -6
      jackd.c

+ 1
- 1
configure.in View File

@@ -5,7 +5,7 @@ AC_CONFIG_AUX_DIR(.)


JACK_MAJOR_VERSION=0 JACK_MAJOR_VERSION=0
JACK_MINOR_VERSION=4 JACK_MINOR_VERSION=4
JACK_MICRO_VERSION=1
JACK_MICRO_VERSION=3


BETA= BETA=




+ 9
- 6
jackd.c View File

@@ -39,6 +39,7 @@ static nframes_t frames_per_interrupt = 64;
static nframes_t srate = 48000; static nframes_t srate = 48000;
static int realtime = 0; static int realtime = 0;
static int realtime_priority = 10; static int realtime_priority = 10;
static int with_fork = 0;


static void static void
cleanup () cleanup ()
@@ -69,9 +70,9 @@ static void
signal_handler (int sig) signal_handler (int sig)
{ {
fprintf (stderr, "killing jackd at %d\n", jackd_pid); fprintf (stderr, "killing jackd at %d\n", jackd_pid);
kill (jackd_pid, SIGKILL);
kill (jackd_pid, SIGTERM);
cleanup (); cleanup ();
exit (-1);
exit (1);
} }


static void static void
@@ -103,7 +104,10 @@ signal_thread (void *arg)
err = sigwait (&signals, &sig); err = sigwait (&signals, &sig);
fprintf (stderr, "exiting due to signal %d\n", sig); fprintf (stderr, "exiting due to signal %d\n", sig);
jack_engine_delete (engine); jack_engine_delete (engine);
cleanup ();
if (!with_fork) {
/* parent cleans up if we forked */
cleanup ();
}
exit (err); exit (err);


/*NOTREACHED*/ /*NOTREACHED*/
@@ -236,7 +240,6 @@ main (int argc, char *argv[])
}; };
int option_index; int option_index;
int opt; int opt;
int no_fork = 0;
opterr = 0; opterr = 0;
while ((opt = getopt_long (argc, argv, options, long_options, &option_index)) != EOF) { while ((opt = getopt_long (argc, argv, options, long_options, &option_index)) != EOF) {
@@ -254,7 +257,7 @@ main (int argc, char *argv[])
break; break;


case 'F': case 'F':
no_fork = 1;
with_fork = 0;
break; break;


case 'P': case 'P':
@@ -273,7 +276,7 @@ main (int argc, char *argv[])
} }
} }


if (no_fork) {
if (with_fork) {
jack_main (); jack_main ();
cleanup (); cleanup ();




Loading…
Cancel
Save