From 5fadc0cbb8577c61d66bd6f19ceaf0507c11e23b Mon Sep 17 00:00:00 2001 From: Jannis Hoffmann Date: Tue, 9 Jul 2024 14:41:53 +0200 Subject: initial clang-format --- src/fd.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/fd.c') diff --git a/src/fd.c b/src/fd.c index 776575c..ad20812 100644 --- a/src/fd.c +++ b/src/fd.c @@ -1,6 +1,7 @@ -#include #include "fd.h" +#include + /** @file fd.c @autor djb @@ -8,23 +9,26 @@ @brief file descriptor manipulation */ -int close(int __fd); /* we won't use unistd.h here */ +int close(int __fd); /* we won't use unistd.h here */ -int fd_copy(int to,int from) +int fd_copy(int to, int from) { if (to == from) return 0; - if (fcntl(from,F_GETFL,0) == -1) return -1; + if (fcntl(from, F_GETFL, 0) == -1) return -1; close(to); - if (fcntl(from,F_DUPFD,to) == -1) return -1; + if (fcntl(from, F_DUPFD, to) == -1) return -1; return 0; } -int fd_move(int to,int from) +int fd_move(int to, int from) { if (to == from) return 0; - if (fd_copy(to,from) == -1) return -1; + if (fd_copy(to, from) == -1) return -1; close(from); return 0; } -int fd_coe(int fd) {return fcntl(fd,F_SETFD,1); } +int fd_coe(int fd) +{ + return fcntl(fd, F_SETFD, 1); +} -- cgit v1.2.3