diff options
author | Leah Neukirchen <leah@vuxu.org> | 2017-03-22 14:38:55 +0100 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2017-03-22 14:38:55 +0100 |
commit | ce99fa1e68fb044a1100e009d3285daab599d4aa (patch) | |
tree | 1907a9da1837a888ec37a16373b5f983a8a9dc85 | |
parent | e05965d4f65ab3ead7e9b1a9c6433feddb8a087e (diff) | |
download | redo-c-ce99fa1e68fb044a1100e009d3285daab599d4aa.tar.gz redo-c-ce99fa1e68fb044a1100e009d3285daab599d4aa.tar.xz redo-c-ce99fa1e68fb044a1100e009d3285daab599d4aa.zip |
redo.c: style
-rw-r--r-- | redo.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/redo.c b/redo.c index ea5fb8d..4885095 100644 --- a/redo.c +++ b/redo.c @@ -221,9 +221,9 @@ check_dofile(const char *fmt, ...) /* dir/base.a.b - will look for dir/base.a.b.do, - dir/default.a.b.do, dir/default.b.do, dir/default.do, - default.a.b.do, default.b.do, and default.do. + will look for dir/base.a.b.do, + dir/default.a.b.do, dir/default.b.do, dir/default.do, + default.a.b.do, default.b.do, and default.do. this function assumes no / in target */ @@ -344,7 +344,8 @@ datefile(int fd) } static int -keepdir() { +keepdir() +{ int fd = open(".", O_RDONLY | O_DIRECTORY | O_CLOEXEC); if (fd < 0) { perror("dir open"); @@ -354,7 +355,8 @@ keepdir() { } static char * -targetchdir(char *target) { +targetchdir(char *target) +{ char *base = strrchr(target, '/'); if (base) { int fd; @@ -378,14 +380,16 @@ targetchdir(char *target) { } static char * -targetdep(char *target) { +targetdep(char *target) +{ static char buf[PATH_MAX]; snprintf(buf, sizeof buf, ".dep.%s", target); return buf; } static char * -targetlock(char *target) { +targetlock(char *target) +{ static char buf[PATH_MAX]; snprintf(buf, sizeof buf, ".lock.%s", target); return buf; @@ -470,7 +474,8 @@ check_deps(char *target) } void -vacate(int implicit) { +vacate(int implicit) +{ if (implicit) implicit_jobs++; else @@ -519,7 +524,8 @@ find_job(pid_t pid) } static int -write_dep(int dep_fd, char *file) { +write_dep(int dep_fd, char *file) +{ int fd = open(file, O_RDONLY); if (fd < 0) return 0; |