Skip to contentSkip to conversation

utmpname(3) returns int instead of void

PATCH In review WANG Cong 2 participants 2 messages Jun 28, 2008 – Jun 29, 2008 1 message not in the archive Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore

WANG Cong

author
#0 lore raw

PATCH 1/1 utmpname(3) returns int instead of void

As pointed by Halesh S, utmpname(3) should return int, just like what it is in glibc's source code.

---

man3/getutent.3 +5 -1
Index: man-pages-3.01/man3/getutent.3
===================================================================
@@ -44,7 +44,7 @@ getutent, getutid, getutline, pututline,
 .br
 .B void endutent(void);
 .sp
-.BI "void utmpname(const char *" file );
+.BI "int utmpname(const char *" file );
 .SH DESCRIPTION
 .BR utmpname ()
 sets the name of the utmp-format file for the other utmp
@@ -116,6 +116,10 @@ and
 return a pointer to a \fIstruct utmp\fP on success, and NULL on failure.
 This \fIstruct utmp\fP is allocated in static storage, and may be
 overwritten by subsequent calls.
+.br
+.BR utmpname()
+returns a value of 0 if the new name was successfully stored, and a
+value of -1 to indicate an error.
 .SH FILES
 /var/run/utmp	database of currently logged-in users
 .br

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20080628181713.GA1605-E5McWMdeTmA/[email protected]

#2 lore raw
Quoted 6 lines · WANG Cong

As pointed by Halesh S, utmpname(3) should return int, just like what it is in glibc's source code.

Thnks! Applied for man-pages-3.02.

Cheers,

Michael

Quoted 25 lines

Index: man-pages-3.01/man3/getutent.3
===================================================================

man3/getutent.3 +5 -1
@@ -44,7 +44,7 @@ getutent, getutid, getutline, pututline,
 .br
 .B void endutent(void);
 .sp
-.BI "void utmpname(const char *" file );
+.BI "int utmpname(const char *" file );
 .SH DESCRIPTION
 .BR utmpname ()
 sets the name of the utmp-format file for the other utmp
@@ -116,6 +116,10 @@ and
 return a pointer to a \fIstruct utmp\fP on success, and NULL on failure.
 This \fIstruct utmp\fP is allocated in static storage, and may be
 overwritten by subsequent calls.
+.br
+.BR utmpname()
+returns a value of 0 if the new name was successfully stored, and a
+value of -1 to indicate an error.
 .SH FILES
 /var/run/utmp  database of currently logged-in users
 .br
Signature · 8 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
man-pages online: http://www.kernel.org/doc/man-pages/online_pages.html
Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html