Skip to content

Commit

Permalink
Remove ztee print_error in favor of log_fatal
Browse files Browse the repository at this point in the history
dadrian committed Jan 25, 2015
1 parent 4da7a10 commit b233907
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/ztee.c
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@
#include <errno.h>
#include <getopt.h>
#include <pthread.h>
#include <unistd.h>

#include "../lib/lockfd.h"
#include "../lib/logger.h"
@@ -63,8 +64,6 @@ pthread_t threads[3];
//it exits
void *process_queue (void* my_q);

void print_error () __attribute__ ((noreturn));

//uses fgets to read from stdin and add it to the zqueue_t
void *read_in (void* my_q);

@@ -248,14 +247,6 @@ void *process_queue(void* my_q)
return NULL;
}

void print_error()
{
//includes incorrect output file format
//
printf("Problem with file format\n");
exit(0);
}

void *read_in(void* my_q)
{
//read in from stdin and add to back of linked list
@@ -462,7 +453,7 @@ void output_file_is_csv()
const char *csv = "csv\n";
const char *json = "jso\n";
if(!strncmp(end_of_file, csv, 3) && !strncmp(end_of_file, json, 3)){
print_error();
log_fatal("ztee", "Invalid output format");
}
if(!strncmp(end_of_file, csv, 3)) output_csv = 1;
if(!strncmp(end_of_file, json, 3)) output_csv = 0;

0 comments on commit b233907

Please sign in to comment.