This is an automated email from the git hooks/post-receive script.
rharwood pushed a change to branch master in repository gssproxy.
from c8c5e8d Include header for writev() new 4f60bf0 Make proc file failure loud but nonfatal
The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference.
Summary of changes: proxy/src/gp_init.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-)
This is an automated email from the git hooks/post-receive script.
rharwood pushed a commit to branch master in repository gssproxy.
commit 4f60bf02a1a68cbb26251e764357b753f80790f3 Author: Robbie Harwood rharwood@redhat.com Date: Thu May 25 13:06:17 2017 -0400
Make proc file failure loud but nonfatal
Signed-off-by: Robbie Harwood rharwood@redhat.com Reviewed-by: Simo Sorce simo@redhat.com Resolves: #190 --- proxy/src/gp_init.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-)
diff --git a/proxy/src/gp_init.c b/proxy/src/gp_init.c index 4673f02..e69934d 100644 --- a/proxy/src/gp_init.c +++ b/proxy/src/gp_init.c @@ -144,11 +144,11 @@ void init_proc_nfsd(struct gp_config *cfg) { char buf[] = "1"; bool enabled = false; - int fd, i, ret; + int fd, ret;
/* check first if any service enabled kernel support */ - for (i = 0; i < cfg->num_svcs; i++) { - if (cfg->svcs[i]->kernel_nfsd == true) { + for (int i = 0; i < cfg->num_svcs; i++) { + if (cfg->svcs[i]->kernel_nfsd) { enabled = true; break; } @@ -161,30 +161,26 @@ void init_proc_nfsd(struct gp_config *cfg) fd = open(LINUX_PROC_USE_GSS_PROXY_FILE, O_RDWR); if (fd == -1) { ret = errno; - fprintf(stderr, "GSS-Proxy is not supported by this kernel since " - "file %s could not be found: %d (%s)\n", - LINUX_PROC_USE_GSS_PROXY_FILE, - ret, gp_strerror(ret)); - exit(1); + GPDEBUG("Kernel doesn't support GSS-Proxy (can't open %s: %d (%s))\n", + LINUX_PROC_USE_GSS_PROXY_FILE, ret, gp_strerror(ret)); + goto fail; }
ret = write(fd, buf, 1); if (ret != 1) { ret = errno; - fprintf(stderr, "Failed to write to %s: %d (%s)\n", - LINUX_PROC_USE_GSS_PROXY_FILE, - ret, gp_strerror(ret)); - exit(1); + GPDEBUG("Failed to write to %s: %d (%s)\n", + LINUX_PROC_USE_GSS_PROXY_FILE, ret, gp_strerror(ret)); }
- ret = close(fd); - if (ret == -1) { - ret = errno; - fprintf(stderr, "Failed to close %s: %d (%s)\n", - LINUX_PROC_USE_GSS_PROXY_FILE, - ret, gp_strerror(ret)); - exit(1); + close(fd); + if (ret != 0) { + goto fail; } + + return; +fail: + GPDEBUG("Problem with kernel communication! NFS server will not work\n"); }
void write_pid(void)
gss-proxy@lists.fedorahosted.org