We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb8737b commit 9d013b1Copy full SHA for 9d013b1
src/gp_init.c
@@ -379,12 +379,14 @@ int init_event_fini(struct gssproxy_ctx *gpctx)
379
static int try_init_proc_nfsd(void)
380
{
381
char buf[] = "1";
382
- int fd, ret;
383
static bool poked = false;
384
static bool warned_once = false;
+ int fd = 1;
385
+ int ret;
386
- if (poked)
387
+ if (poked) {
388
return 0;
389
+ }
390
391
fd = open(LINUX_PROC_USE_GSS_PROXY_FILE, O_RDWR);
392
if (fd == -1) {
@@ -411,7 +413,9 @@ static int try_init_proc_nfsd(void)
411
413
ret = 0;
412
414
415
out:
- close(fd);
416
+ if (fd != -1) {
417
+ close(fd);
418
419
return ret;
420
}
421
0 commit comments