diff options
author | Harald Welte <laforge@gnumonks.org> | 2017-01-15 17:58:29 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-01-23 12:20:33 +0000 |
commit | 44c0f63de64ffeaffff7429f3e5e474fe8dd5343 (patch) | |
tree | e40b9f309de9e67502a8fcb2de1cc102984ff0d6 /src/logging.c | |
parent | 505a22fc5102b69cdb7a910fb65da67e41d7f649 (diff) |
disable various code if building for bare-iron embedded
We don't have file-based I/O nor ethernet devices with mac addresses
when building for OsmocomBB.
Change-Id: I01a9e6d8dbe885dbeac2769b84931a4d44f7a3a5
Diffstat (limited to 'src/logging.c')
-rw-r--r-- | src/logging.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/logging.c b/src/logging.c index b0bca549..9b7d6f45 100644 --- a/src/logging.c +++ b/src/logging.c @@ -584,12 +584,14 @@ void log_set_category_filter(struct log_target *target, int category, target->categories[category].loglevel = level; } +#if (!EMBEDDED) static void _file_output(struct log_target *target, unsigned int level, const char *log) { fprintf(target->tgt_file.out, "%s", log); fflush(target->tgt_file.out); } +#endif /*! \brief Create a new log target skeleton * \returns dynamically-allocated log target @@ -654,6 +656,7 @@ struct log_target *log_target_create_stderr(void) #endif /* stderr */ } +#if (!EMBEDDED) /*! \brief Create a new file-based log target * \param[in] fname File name of the new log file * \returns Log target in case of success, NULL otherwise @@ -677,6 +680,7 @@ struct log_target *log_target_create_file(const char *fname) return target; } +#endif /*! \brief Find a registered log target * \param[in] type Log target type @@ -707,6 +711,7 @@ void log_target_destroy(struct log_target *target) /* just in case, to make sure we don't have any references */ log_del_target(target); +#if (!EMBEDDED) if (target->output == &_file_output) { /* since C89/C99 says stderr is a macro, we can safely do this! */ #ifdef stderr @@ -718,6 +723,7 @@ void log_target_destroy(struct log_target *target) target->tgt_file.out = NULL; } } +#endif talloc_free(target); } |