Browse Source

Fixed bug when output pipe is closed without a KILL signal

git-svn-id: https://bucket.mit.edu/svn/nilm/acquisition/ethstream@7301 ddd99763-3ecb-0310-9145-efcb8ce7c51f
tags/ethstream-1.1
zacharyc 14 years ago
parent
commit
6562c0b787
2 changed files with 10 additions and 5 deletions
  1. +8
    -3
      ethstream.c
  2. +2
    -2
      nerdjack.c

+ 8
- 3
ethstream.c View File

@@ -477,9 +477,14 @@ nerdDoStream (const char *address, int *channel_list, int channel_count,
goto out;
}

if (nerd_data_stream
retval = nerd_data_stream
(fd_data, channel_count, channel_list, precision, convert, lines,
showmem, &currentcount, period) < 0)
showmem, &currentcount, period);
if(retval == -3)
{
retval = 0;
}
if(retval < 0)
{
info ("Failed to open data stream\n");
goto out1;
@@ -627,5 +632,5 @@ data_callback (int channels, uint16_t * data, void *context)

bad:
info ("Output error (disk full?)\n");
return -1;
return -3;
}

+ 2
- 2
nerdjack.c View File

@@ -200,7 +200,7 @@ nerd_send_command (const char *address, void *command, int length)
if (0 != strcmp ("OK", buf))
{
verb ("Did not receive OK. Received %s\n", buf);
return -3;
return -1;
}

return 0;
@@ -480,7 +480,7 @@ nerd_data_stream (int data_fd, int numChannels, int *channel_list,

bad:
info ("Output error (disk full?)\n");
return -1;
return -3;

}



Loading…
Cancel
Save