diff options
author | Jeff Layton <jlayton@redhat.com> | 2013-11-20 15:00:41 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2013-11-20 15:04:47 -0500 |
commit | 6a46d870c61433c8dea0270d9c10702b7b4b3d99 (patch) | |
tree | f0f8eb2cd22742982f913a51e089809138d3013d /support/include/nfslib.h | |
parent | 95af6be7a7039282243118447d6d1895671504da (diff) | |
download | nfs-utils-6a46d870c61433c8dea0270d9c10702b7b4b3d99.tar.gz nfs-utils-6a46d870c61433c8dea0270d9c10702b7b4b3d99.tar.xz nfs-utils-6a46d870c61433c8dea0270d9c10702b7b4b3d99.zip |
nfs-utils: consolidate mydaemon() and release_parent() implementations
We currently have 2 cut-and-paste versions of this code. One for idmapd
and one for svcgssd.[1]
The two are basically equivalent but there are some small differences,
mostly related to how errors in that function are logged. svcgssd uses
printerr() with a priority of 1, which only prints errors if -v was
specified. That doesn't seem to be quite right. Daemonizing errors are
necessarily fatal and should be logged as such. The one for idmapd uses
err(), which always prints to stderr even though we have the xlog
facility set up. Since both have xlog configured at this point, log the
errors using xlog_err() instead.
The only other significant difference I see is that the idmapd version
will open "/" if it's unable to open "/dev/null". I believe that however
was a holdover from an earlier version of that function that did not
error out when we were unable to open a file descriptor. Since the
function does that now, I don't believe we need that fallback anymore.
[1]: technically, we have a third in statd too, but it's different
enough that I don't want to touch it here.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support/include/nfslib.h')
-rw-r--r-- | support/include/nfslib.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/support/include/nfslib.h b/support/include/nfslib.h index f210a06..ce4b14b 100644 --- a/support/include/nfslib.h +++ b/support/include/nfslib.h @@ -128,6 +128,10 @@ void fputrmtabent(FILE *fp, struct rmtabent *xep, long *pos); void fendrmtabent(FILE *fp); void frewindrmtabent(FILE *fp); +/* mydaemon */ +void mydaemon(int nochdir, int noclose, int *pipefds); +void release_parent(int *pipefds); + /* * wildmat borrowed from INN */ |