diff options
author | Jannis Hoffmann <jannis@fehcom.de> | 2024-07-03 15:52:39 +0200 |
---|---|---|
committer | Jannis Hoffmann <jannis@fehcom.de> | 2024-07-03 15:52:39 +0200 |
commit | a6a7d6ce079cabdaf2fa502b2e2cf15e5428ac6f (patch) | |
tree | b88cc7a8457658d67e0321718556ac807f6bccf3 /src/trigger.c | |
parent | 00be7622c428f279872f84569f098ce16150f8a8 (diff) |
format files
Diffstat (limited to 'src/trigger.c')
-rw-r--r-- | src/trigger.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/trigger.c b/src/trigger.c index ec22e11..4b7cc49 100644 --- a/src/trigger.c +++ b/src/trigger.c @@ -1,41 +1,43 @@ -#include "select.h" -#include "ndelay.h" -#include "open.h" #include "trigger.h" + #include "close.h" +#include "ndelay.h" +#include "open.h" +#include "select.h" static int fd = -1; -void trigger_set() +void trigger_set() { if (fd != -1) close(fd); fd = open_read("lock/trigger"); } -void trigger_selprep(int *nfds,fd_set *rfds) +void trigger_selprep(int *nfds, fd_set *rfds) { if (fd != -1) { - FD_SET(fd,rfds); + FD_SET(fd, rfds); if (*nfds < fd + 1) *nfds = fd + 1; } } -int trigger_pulled(fd_set *rfds) +int trigger_pulled(fd_set *rfds) { - if (fd != -1) if (FD_ISSET(fd,rfds)) return 1; + if (fd != -1) + if (FD_ISSET(fd, rfds)) return 1; return 0; } -void write(); /* compiler warning (temp) */ +void write(); /* compiler warning (temp) */ -void triggerpull() +void triggerpull() { int fd; fd = open_write("lock/trigger"); if (fd >= 0) { ndelay_on(fd); - write(fd,"",1); /* if it fails, bummer */ + write(fd, "", 1); /* if it fails, bummer */ close(fd); } } |