[master] 0b69439 Squash further warn_unused_result warnings.
Lasse Karstensen
lkarsten at varnish-software.com
Thu Sep 4 16:06:16 CEST 2014
commit 0b69439ccbabe3b77fae444ef5796d138a453067
Author: Lasse Karstensen <lkarsten at varnish-software.com>
Date: Thu Sep 4 14:45:11 2014 +0200
Squash further warn_unused_result warnings.
Not being able to fchown() is normal when running varnishd
unprivileged, so don't report failure unless running as root.
diff --git a/bin/varnishd/mgt/mgt_vcc.c b/bin/varnishd/mgt/mgt_vcc.c
index b76b016..35e3806 100644
--- a/bin/varnishd/mgt/mgt_vcc.c
+++ b/bin/varnishd/mgt/mgt_vcc.c
@@ -248,7 +248,10 @@ mgt_run_cc(const char *vcl, struct vsb *sb, int C_flag, unsigned *status)
*status = 2;
return (NULL);
}
- (void)fchown(sfd, mgt_param.uid, mgt_param.gid);
+ if (fchown(sfd, mgt_param.uid, mgt_param.gid) != 0)
+ if (geteuid() == 0)
+ VSB_printf(sb, "Failed to change owner on %s: %s\n",
+ sf, strerror(errno));
AZ(close(sfd));
@@ -286,7 +289,10 @@ mgt_run_cc(const char *vcl, struct vsb *sb, int C_flag, unsigned *status)
*status = 2;
return (NULL);
}
- (void)fchown(i, mgt_param.uid, mgt_param.gid);
+ if (fchown(i, mgt_param.uid, mgt_param.gid) != 0)
+ if (geteuid() == 0)
+ VSB_printf(sb, "Failed to change owner on %s: %s\n",
+ of, strerror(errno));
AZ(close(i));
/* Build the C-compiler command line */
More information about the varnish-commit
mailing list