add media-radio/hamfax

This commit is contained in:
Florian Tham
2017-07-18 15:09:12 +02:00
parent 2146ca4629
commit 107e7da0b9
3 changed files with 91 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
diff --git a/lib/log.c b/lib/log.c
index b9c1867..b58070a 100644
--- a/lib/log.c
+++ b/lib/log.c
@@ -23,41 +23,14 @@
#include <time.h>
#include "config.h"
-#ifdef HAVE_LIBHAMLIB
-#include <hamlib/rig.h>
-#endif
-
static FILE *log_file;
-#ifdef HAVE_LIBHAMLIB
-/**
- * The default setting for hamlib is logging to stderr. Adjust it to our log,
- * or use /dev/null to redirect the hamlib log.
- */
-static void set_hamlib_log()
-{
- if (log_file) {
- rig_set_debug_file(log_file);
-
- } else {
- FILE *dev_null;
-
- dev_null = fopen("/dev/null", "w");
- if (dev_null)
- rig_set_debug_file(dev_null);
- }
-}
-#else
-static inline void set_hamlib_log(FILE *) { }
-#endif
-
int log_open(const char *file)
{
log_file = fopen(file, "a");
if (!log_file)
return errno;
- set_hamlib_log();
return 0;
}
@@ -85,8 +58,6 @@ int log_open_argv(int argc, char **argv)
if (open && !filename)
log_file = stderr;
- set_hamlib_log();
-
return 0;
}