Skip to content

Commit

Permalink
moved fopen raw output to after if target != stdout statement #123
Browse files Browse the repository at this point in the history
turns out the raw target was never opened if the target was /dev/stdout
the file descriptor was opened within an if (target != /dev/stdout) statement
  • Loading branch information
karlstav committed Jun 6, 2017
1 parent d8df114 commit 6a07a23
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions cava.c
Original file line number Diff line number Diff line change
Expand Up @@ -841,18 +841,16 @@ as of 0.4.0 all options are specified in config file, see in '/home/username/.co
}
fptest = open(raw_target, O_RDONLY | O_NONBLOCK, 0644); //fifo needs to be open for reading in order to write to it
}


fp = open(raw_target, O_WRONLY | O_NONBLOCK | O_CREAT, 0644);
if (fp == -1) {
printf("could not open file %s for writing\n",raw_target);
exit(1);
}
printf("open file %s for writing raw ouput\n",raw_target);
}


fp = open(raw_target, O_WRONLY | O_NONBLOCK | O_CREAT, 0644);
if (fp == -1) {
printf("could not open file %s for writing\n",raw_target);
exit(1);
}

printf("open file %s for writing raw ouput\n",raw_target);

//height and with must be hardcoded for raw output.
h = 112;
w = 200;
}
Expand Down

0 comments on commit 6a07a23

Please sign in to comment.