Change-Id: I45bfd0d5fe616f1a338fc04f0c0ec1f15fb61517
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
libexec_PROGRAMS = dlog-log-critical
-dlog_log_critical_CFLAGS = \
+dlog_log_critical_CXXFLAGS = \
$(AM_CFLAGS) \
+ -std=c++14 \
-fPIE
dlog_log_critical_LDFLAGS = \
$(AM_LDFLAGS) \
-pie
-dlog_log_critical_SOURCES = src/log-critical/log-critical.c
+dlog_log_critical_SOURCES = src/log-critical/log-critical.cpp
bin_PROGRAMS += dlog_logger
PLATFORM_INIT
# Checks for programs.
-dnl AC_PROG_CXX
+AC_PROG_CXX
AC_PROG_CC
AC_PROG_GCC_TRADITIONAL
AC_PROG_LIBTOOL
#define DLOG_CRITICAL_LOGFILE "/var/log/dlog/critical"
#endif
+inline void close_fd(const int *fd) { if (*fd >= 0) close(*fd); }
+
int main (int argc, char **argv)
{
if (argc != 2) // Usage: ./dlog-log-critical "formatted message"
return EXIT_FAILURE;
- inline void close_fd(const int *fd) { if (*fd >= 0) close(*fd); }
__attribute__((cleanup(close_fd))) const int fd = open(DLOG_CRITICAL_LOGFILE, O_WRONLY | O_APPEND | O_SYNC);
if (fd < 0)
return EXIT_FAILURE;