From 766d936d60d11cef4d8b126cdd781a1828ae9964 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 4 Jan 2016 01:10:18 +0100 Subject: haiku MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/parse_10deg.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/parse_10deg.c') diff --git a/src/parse_10deg.c b/src/parse_10deg.c index aa82804..245814b 100644 --- a/src/parse_10deg.c +++ b/src/parse_10deg.c @@ -14,6 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ +#include "haiku.h" #include #include #include @@ -46,7 +47,7 @@ ciexyy_to_srgb(double x, double y, double Y, double *r, double *g, double *b) } -int main(void) +int main(int argc, char *argv[]) { double xyrgb[5]; struct stat attr; @@ -54,15 +55,17 @@ int main(void) while (fscanf(stdin, "%lf %lf\n", xyrgb + 0, xyrgb + 1) == 2) { ciexyy_to_srgb(xyrgb[0], xyrgb[1], 1.0, xyrgb + 2, xyrgb + 3, xyrgb + 4); if (write(1, xyrgb, sizeof(xyrgb)) < (ssize_t)sizeof(xyrgb)) - return perror(""), 1; + goto fail; } if (write(1, xyrgb, sizeof(xyrgb)) < (ssize_t)sizeof(xyrgb)) /* sugar */ - return perror(""), 1; + goto fail; if (fstat(1, &attr)) - return perror(""), 1; + goto fail; if ((size_t)(attr.st_size) != (EXPECTED_ELEMENTS + 1) * 5 * sizeof(double)) return 1; return 0; +fail: + return haiku(argc ? *argv : "parse_10deg"), -1; } -- cgit v1.2.3-70-g09d2