diff options
author | 2019-02-12 19:19:13 +0000 | |
---|---|---|
committer | 2019-02-12 19:19:13 +0000 | |
commit | ac523f9ac44fa08f08058046f46ac8574a016a0a (patch) | |
tree | 8fe3a528b6ee00e8aa2666d8d8200196f075f8e4 | |
parent | sync (diff) | |
download | wireguard-openbsd-ac523f9ac44fa08f08058046f46ac8574a016a0a.tar.xz wireguard-openbsd-ac523f9ac44fa08f08058046f46ac8574a016a0a.zip |
sync
commit e589e5f657ef334e6fcbfb76962fbd380d13fd2e
Author: kristaps <>
Date: Tue Feb 12 08:05:32 2019 +0000
Put unveil() functions on their own line. This makes it easier for my secret
portability shim I use for valgrind on linux.
-rw-r--r-- | usr.bin/rsync/flist.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/usr.bin/rsync/flist.c b/usr.bin/rsync/flist.c index 9a42012a948..09b326782ce 100644 --- a/usr.bin/rsync/flist.c +++ b/usr.bin/rsync/flist.c @@ -1,4 +1,4 @@ -/* $Id: flist.c,v 1.9 2019/02/12 19:13:03 benno Exp $ */ +/* $Id: flist.c,v 1.10 2019/02/12 19:19:13 benno Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -733,7 +733,8 @@ flist_gen_dirent(struct sess *sess, char *root, struct flist **fl, size_t *sz, if (!flist_append(sess, f, &st, root)) { ERRX1(sess, "flist_append"); return 0; - } else if (unveil(root, "r") == -1) { + } + if (unveil(root, "r") == -1) { ERR(sess, "%s: unveil", root); return 0; } @@ -752,7 +753,8 @@ flist_gen_dirent(struct sess *sess, char *root, struct flist **fl, size_t *sz, if (!flist_append(sess, f, &st, root)) { ERRX1(sess, "flist_append"); return 0; - } else if (unveil(root, "r") == -1) { + } + if (unveil(root, "r") == -1) { ERR(sess, "%s: unveil", root); return 0; } @@ -855,7 +857,8 @@ flist_gen_dirent(struct sess *sess, char *root, struct flist **fl, size_t *sz, if (errno) { ERR(sess, "fts_read"); goto out; - } else if (unveil(root, "r") == -1) { + } + if (unveil(root, "r") == -1) { ERR(sess, "%s: unveil", root); goto out; } @@ -955,7 +958,8 @@ flist_gen_files(struct sess *sess, size_t argc, char **argv, if (unveil(argv[i], "r") == -1) { ERR(sess, "%s: unveil", argv[i]); goto out; - } else if (!flist_append(sess, f, &st, argv[i])) { + } + if (!flist_append(sess, f, &st, argv[i])) { ERRX1(sess, "flist_append"); goto out; } @@ -996,7 +1000,8 @@ flist_gen(struct sess *sess, size_t argc, char **argv, struct flist **flp, if (unveil(NULL, NULL) == -1) { ERR(sess, "unveil"); return 0; - } else if (!rc) + } + if (!rc) return 0; qsort(*flp, *sz, sizeof(struct flist), flist_cmp); |