Browse Source

fixes for pipe close issue on RH systems

git-svn-id: svn+ssh://jackaudio.org/trunk/jack@440 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.109.0
pbd 22 years ago
parent
commit
332ecb7d29
3 changed files with 26 additions and 4 deletions
  1. +3
    -2
      configure.in
  2. +7
    -0
      jackd/jackd.c
  3. +16
    -2
      jackd/jackstart.c

+ 3
- 2
configure.in View File

@@ -13,8 +13,9 @@ dnl micro version = incremented when implementation-only
dnl changes are made
dnl ---
JACK_MAJOR_VERSION=0
JACK_MINOR_VERSION=74
JACK_MICRO_VERSION=2
JACK_MINOR_VERSION=75
JACK_MICRO_VERSION=0


dnl ---
dnl HOWTO: updating the jack protocal version


+ 7
- 0
jackd/jackd.c View File

@@ -329,6 +329,13 @@ main (int argc, char *argv[])
/* check to see if there is a pipe in the right descriptor */
if ((status = fstat (PIPE_WRITE_FD, &pipe_stat)) == 0 && S_ISFIFO(pipe_stat.st_mode)) {
/* tell jackstart we are up and running */

char c = 1;

if (write (PIPE_WRITE_FD, &c, 1) != 1) {
fprintf (stderr, "cannot write to jackstart sync pipe %d (%s)\n", PIPE_WRITE_FD, strerror (errno));
}

if (close(PIPE_WRITE_FD) != 0) {
fprintf(stderr, "jackd: error on startup pipe close: %s\n", strerror (errno));
} else {


+ 16
- 2
jackd/jackstart.c View File

@@ -203,7 +203,6 @@ int main(int argc, char **argv)
gid_t gid;
int pipe_fds[2];
int err;
char buf[1];

parent_pid = getpid ();

@@ -301,7 +300,22 @@ int main(int argc, char **argv)
close(PIPE_WRITE_FD);

/* wait for jackd to start */
while (read(PIPE_READ_FD, buf, sizeof(buf)) == -1 && errno == EINTR) { }
while (1) {
int ret;
char c;

/* picking up pipe closure is a tricky business.
this seems to work as well as anything else.
*/

ret = read(PIPE_READ_FD, &c, 1);
fprintf (stderr, "back from read, ret = %d errno == %s\n", ret, strerror (errno));
if (ret == 1) {
break;
} else if (errno != EINTR) {
break;
}
}

/* set privileges on jackd process */
if (give_capabilities (parent_pid) != 0) {


Loading…
Cancel
Save