From 90106ba794458787db91b8c85f5f8740831f14bd Mon Sep 17 00:00:00 2001 From: Calvin Morrison Date: Wed, 2 Oct 2013 22:53:12 -0400 Subject: provide errno error details --- kmer_frequency_per_sequence.c | 4 +++- kmer_total_count.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/kmer_frequency_per_sequence.c b/kmer_frequency_per_sequence.c index 9cda533..aa18dd6 100644 --- a/kmer_frequency_per_sequence.c +++ b/kmer_frequency_per_sequence.c @@ -1,7 +1,9 @@ // Copyright 2013 Calvin Morrison +#include #include #include #include +#include #include "kmer_utils.h" @@ -22,7 +24,7 @@ int main(int argc, char **argv) { FILE *fh = fopen(argv[1], "r" ); if(fh == NULL) { - fprintf(stderr, "Couldn't open: %s\n", argv[1]); + fprintf(stderr, "Error opening %s - %s\n", argv[1], strerror(errno)); exit(EXIT_FAILURE); } diff --git a/kmer_total_count.c b/kmer_total_count.c index 0f44601..4fadf03 100644 --- a/kmer_total_count.c +++ b/kmer_total_count.c @@ -1,7 +1,9 @@ // Copyright 2013 Calvin Morrison +#include #include #include #include +#include #include "kmer_utils.h" @@ -23,7 +25,7 @@ int main(int argc, char **argv) { FILE *fh = fopen(argv[1], "r"); if(fh == NULL) { - fprintf(stderr, "Couldn't open: %s\n", argv[1]); + fprintf(stderr, "Error opening %s - %s\n", argv[1], strerror(errno)); exit(EXIT_FAILURE); } -- cgit v1.2.3