diff options
author | Timo Teräs <timo.teras@iki.fi> | 2014-12-06 12:21:27 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2014-12-07 10:20:40 -0500 |
commit | 6e5a97f2a1fd2c40a89c0846cb1e8f1b3bfd3a97 (patch) | |
tree | 91f012b0baea92a992dbb030d9e838c3d7778fc2 /utils/gssd/svcgssd_main_loop.c | |
parent | 510465f44669be366fdb59f40372a9c6123a0231 (diff) | |
download | nfs-utils-6e5a97f2a1fd2c40a89c0846cb1e8f1b3bfd3a97.tar.gz nfs-utils-6e5a97f2a1fd2c40a89c0846cb1e8f1b3bfd3a97.tar.xz nfs-utils-6e5a97f2a1fd2c40a89c0846cb1e8f1b3bfd3a97.zip |
gssd: talk to kernel using file descriptors instead of FILE
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/gssd/svcgssd_main_loop.c')
-rw-r--r-- | utils/gssd/svcgssd_main_loop.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/utils/gssd/svcgssd_main_loop.c b/utils/gssd/svcgssd_main_loop.c index 2b4111c..b5681ce 100644 --- a/utils/gssd/svcgssd_main_loop.c +++ b/utils/gssd/svcgssd_main_loop.c @@ -54,19 +54,18 @@ void gssd_run() { int ret; - FILE *f; + int f; struct pollfd pollfd; #define NULLRPC_FILE "/proc/net/rpc/auth.rpcsec.init/channel" - f = fopen(NULLRPC_FILE, "rw"); - - if (!f) { + f = open(NULLRPC_FILE, O_RDWR); + if (f < 0) { printerr(0, "failed to open %s: %s\n", NULLRPC_FILE, strerror(errno)); exit(1); } - pollfd.fd = fileno(f); + pollfd.fd = f; pollfd.events = POLLIN; while (1) { int save_err; |