trigger: reduce indentation level in trigger_event()
[project/procd.git] / trace / trace.c
index 12f0ee6..b0005b8 100644 (file)
@@ -14,9 +14,9 @@
 #define _GNU_SOURCE
 #include <stddef.h>
 #include <sys/ptrace.h>
+#include <sys/types.h>
 #include <sys/user.h>
 #include <sys/wait.h>
-#include <sys/types.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -42,6 +42,8 @@
 # define EF_REG2       8
 # endif
 #define reg_syscall_nr (EF_REG2 / 4)
+#elif defined(__arm__)
+#define reg_syscall_nr _offsetof(struct user, regs.uregs[7])
 #else
 #error tracing is not supported on this architecture
 #endif
@@ -51,7 +53,7 @@
 } while (0)
 
 #define ERROR(fmt, ...) do { \
-       syslog(0, "utrace: "fmt, ## __VA_ARGS__); \
+       syslog(LOG_ERR, "utrace: "fmt, ## __VA_ARGS__); \
        fprintf(stderr, "utrace: "fmt, ## __VA_ARGS__); \
 } while (0)