summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorghelmer <ghelmer@FreeBSD.org>2012-01-10 21:47:58 +0000
committerghelmer <ghelmer@FreeBSD.org>2012-01-10 21:47:58 +0000
commit80ebde6f3d4c02ca44dace1b4e38a3f8c108b654 (patch)
treea19f24ac59e5727c15901c0a775e1630bf5859e8
parent10c35ce6a7ce675b54be3fb34106d11202bf2f32 (diff)
downloadFreeBSD-src-80ebde6f3d4c02ca44dace1b4e38a3f8c108b654.zip
FreeBSD-src-80ebde6f3d4c02ca44dace1b4e38a3f8c108b654.tar.gz
Style fixes courtesy of pjd.
-rw-r--r--lib/libutil/pidfile.36
-rw-r--r--lib/libutil/pidfile.c1
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/libutil/pidfile.3 b/lib/libutil/pidfile.3
index e11276f..c224a9b 100644
--- a/lib/libutil/pidfile.3
+++ b/lib/libutil/pidfile.3
@@ -100,7 +100,7 @@ function closes and removes a pidfile.
.Pp
The
.Fn pidfile_fileno
-function returns the file descriptor for the open pid file.
+function returns the file descriptor for the open pidfile.
.Sh RETURN VALUES
The
.Fn pidfile_open
@@ -118,7 +118,9 @@ will be set.
The
.Fn pidfile_fileno
function returns the low-level file descriptor.
-It returns -1 and sets
+It returns
+.Li -1
+and sets
.Va errno
if a NULL
.Vt pidfh
diff --git a/lib/libutil/pidfile.c b/lib/libutil/pidfile.c
index cf5acce..6bfa376 100644
--- a/lib/libutil/pidfile.c
+++ b/lib/libutil/pidfile.c
@@ -270,6 +270,7 @@ pidfile_remove(struct pidfh *pfh)
int
pidfile_fileno(struct pidfh *pfh)
{
+
if (pfh == NULL || pfh->pf_fd == -1) {
errno = EDOOFUS;
return (-1);
OpenPOWER on IntegriCloud