From 3431230e59249001b6f45250fc3293a088b9ed15 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 12 Apr 2016 01:46:36 -0400 Subject: graceful shutdown --- src/freenect-server.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/freenect-server.c b/src/freenect-server.c index f6c2016..8680687 100644 --- a/src/freenect-server.c +++ b/src/freenect-server.c @@ -56,7 +56,6 @@ bool running = true; } else { \ error(0, 0, "%s: panic: neither feof nor ferror", name); \ } \ - exitcode = EXIT_FAILURE; \ } \ stop(0); \ } while(0) @@ -113,7 +112,7 @@ void write_imageframe(const char *name, FILE *stream, struct mpjpg_encoder *e, J if (fwrite("\r\n", 2, 1, stream) < 1) stdioerror(stream, name); if (fflush(stream) != 0) - stdioerror(stream, name); + threaderror(0, errno, name); } /* Stream handlers */ @@ -162,7 +161,7 @@ void handle_accel(freenect_device *dev UNUSED, freenect_raw_tilt_state* data) { stdioerror(accel_stream, "accel.mjson"); free(json); if (fflush(accel_stream) != 0) - threaderror(EXIT_FAILURE, errno, "accel.mjson"); + threaderror(0, errno, "accel.mjson"); } uint8_t depth_rgb[640*480*3]; -- cgit v1.2.3-54-g00ecf