aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2016-11-19 00:09:35 +0100
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2016-11-19 00:09:35 +0100
commit5ba42019dcad93811d717a60ed7ce4ca5d45d41d (patch)
tree449b8087f7e67b905f6fb0c1896c30548468f51a
parent7081c630326cea65b447446e83a2af74b82cc935 (diff)
downloadblogc-5ba42019dcad93811d717a60ed7ce4ca5d45d41d.tar.gz
blogc-5ba42019dcad93811d717a60ed7ce4ca5d45d41d.tar.bz2
blogc-5ba42019dcad93811d717a60ed7ce4ca5d45d41d.zip
git-receiver: minor optimizations
-rw-r--r--src/blogc-git-receiver/pre-receive.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/blogc-git-receiver/pre-receive.c b/src/blogc-git-receiver/pre-receive.c
index 7693789..a109fac 100644
--- a/src/blogc-git-receiver/pre-receive.c
+++ b/src/blogc-git-receiver/pre-receive.c
@@ -116,7 +116,7 @@ bgr_pre_receive_hook(int argc, char *argv[])
if (isatty(STDIN_FILENO)) {
char *htdocs_sym = bc_strdup_printf("%s/htdocs", repo_dir);
- if (0 != access(htdocs_sym, F_OK)) {
+ if (0 != access(htdocs_sym, R_OK)) {
fprintf(stderr, "error: no previous build found. nothing to "
"rebuild.\n");
free(htdocs_sym);
@@ -136,6 +136,7 @@ bgr_pre_receive_hook(int argc, char *argv[])
if (bc_strv_length(pieces) != 2) {
fprintf(stderr, "error: failed to parse the hash of last built "
"commit.\n");
+ bc_strv_free(pieces);
rv = 1;
goto cleanup;
}