Use err(3). -Wall cleaning. cosmetics in man page.
This commit is contained in:
parent
754c3c574d
commit
622058ebd0
@ -31,7 +31,7 @@
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\" $Id: rpc.rusersd.8,v 1.4 1997/02/22 14:22:16 peter Exp $
|
||||
.\"
|
||||
.Dd June 7, 1993
|
||||
.Dt RPC.RUSERSD 8
|
||||
@ -42,7 +42,7 @@
|
||||
.Sh SYNOPSIS
|
||||
.Nm /usr/libexec/rpc.rusersd
|
||||
.Sh DESCRIPTION
|
||||
.Nm rpc.rusersd
|
||||
.Nm Rpc.rusersd
|
||||
is a server which returns information about users
|
||||
currently logged in to the system.
|
||||
.Pp
|
||||
@ -50,12 +50,14 @@ The currently logged in users are queried using the
|
||||
.Xr rusers 1
|
||||
command.
|
||||
The
|
||||
.Nm rpc.rusersd
|
||||
.Nm
|
||||
daemon is normally invoked by
|
||||
.Xr inetd 8 .
|
||||
.Pp
|
||||
.Nm rpc.rusersd
|
||||
uses an RPC protocol defined in
|
||||
.Nm Rpc.rusersd
|
||||
uses an
|
||||
.Tn RPC
|
||||
protocol defined in
|
||||
.Pa /usr/include/rpcsvc/rnusers.x .
|
||||
.Sh SEE ALSO
|
||||
.Xr rusers 1 ,
|
||||
|
@ -32,19 +32,22 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char rcsid[] = "$Id$";
|
||||
static const char rcsid[] =
|
||||
"$Id$";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <signal.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <utmp.h>
|
||||
#include <stdio.h>
|
||||
#include <syslog.h>
|
||||
#include <err.h>
|
||||
#include <rpc/rpc.h>
|
||||
#include <sys/socket.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <syslog.h>
|
||||
#include <utmp.h>
|
||||
#ifdef XIDLE
|
||||
#include <setjmp.h>
|
||||
#include <X11/Xlib.h>
|
||||
@ -117,18 +120,18 @@ XqueryIdle(char *display)
|
||||
}
|
||||
if (XidleQueryExtension(dpy, &first_event, &first_error)) {
|
||||
if (!XGetIdleTime(dpy, &IdleTime)) {
|
||||
syslog(LOG_ERR, "%s: Unable to get idle time.", display);
|
||||
syslog(LOG_ERR, "%s: unable to get idle time", display);
|
||||
return(-1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
syslog(LOG_ERR, "%s: Xidle extension not loaded.", display);
|
||||
syslog(LOG_ERR, "%s: Xidle extension not loaded", display);
|
||||
return(-1);
|
||||
}
|
||||
XCloseDisplay(dpy);
|
||||
}
|
||||
else {
|
||||
syslog(LOG_ERR, "%s: Server grabbed for over 10 seconds.", display);
|
||||
syslog(LOG_ERR, "%s: server grabbed for over 10 seconds", display);
|
||||
return(-1);
|
||||
}
|
||||
(void) signal (SIGALRM, SIG_DFL);
|
||||
@ -380,10 +383,8 @@ rusers_service(rqstp, transp)
|
||||
if (result != NULL && !svc_sendreply(transp, xdr_result, result)) {
|
||||
svcerr_systemerr(transp);
|
||||
}
|
||||
if (!svc_freeargs(transp, xdr_argument, &argument)) {
|
||||
(void)fprintf(stderr, "unable to free arguments\n");
|
||||
exit(1);
|
||||
}
|
||||
if (!svc_freeargs(transp, xdr_argument, &argument))
|
||||
errx(1, "unable to free arguments");
|
||||
leave:
|
||||
if (from_inetd)
|
||||
exit(0);
|
||||
|
@ -32,11 +32,14 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char rcsid[] = "$Id$";
|
||||
static const char rcsid[] =
|
||||
"$Id$";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <rpc/rpc.h>
|
||||
#include <rpc/pmap_clnt.h>
|
||||
#include <signal.h>
|
||||
#include <syslog.h>
|
||||
#define utmp rutmp
|
||||
@ -55,6 +58,7 @@ cleanup()
|
||||
exit(0);
|
||||
}
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
@ -90,16 +94,16 @@ main(argc, argv)
|
||||
|
||||
transp = svcudp_create(sock);
|
||||
if (transp == NULL) {
|
||||
syslog(LOG_ERR, "cannot create udp service.");
|
||||
syslog(LOG_ERR, "cannot create udp service");
|
||||
exit(1);
|
||||
}
|
||||
if (!svc_register(transp, RUSERSPROG, RUSERSVERS_IDLE, rusers_service, proto)) {
|
||||
syslog(LOG_ERR, "unable to register (RUSERSPROG, RUSERSVERS_IDLE, %s).", proto?"udp":"(inetd)");
|
||||
syslog(LOG_ERR, "unable to register (RUSERSPROG, RUSERSVERS_IDLE, %s)", proto?"udp":"(inetd)");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (!svc_register(transp, RUSERSPROG, RUSERSVERS_ORIG, rusers_service, proto)) {
|
||||
syslog(LOG_ERR, "unable to register (RUSERSPROG, RUSERSVERS_ORIG, %s).", proto?"udp":"(inetd)");
|
||||
syslog(LOG_ERR, "unable to register (RUSERSPROG, RUSERSVERS_ORIG, %s)", proto?"udp":"(inetd)");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user