Remove unused #includes and make it compile again with -DDEBUG. Use syslog()
instead of errx() when being a daemon.
This commit is contained in:
parent
859c540701
commit
fcccc2999a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=32312
@ -33,19 +33,16 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static const char rcsid[] =
|
static const char rcsid[] =
|
||||||
"$Id$";
|
"$Id: rusers_proc.c,v 1.7 1997/11/26 07:36:50 charnier Exp $";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <err.h>
|
#ifdef DEBUG
|
||||||
#include <rpc/rpc.h>
|
#include <errno.h>
|
||||||
#include <signal.h>
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/time.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#include <utmp.h>
|
#include <utmp.h>
|
||||||
#ifdef XIDLE
|
#ifdef XIDLE
|
||||||
@ -248,7 +245,7 @@ rusers_num()
|
|||||||
ufp = fopen(_PATH_UTMP, "r");
|
ufp = fopen(_PATH_UTMP, "r");
|
||||||
if (!ufp) {
|
if (!ufp) {
|
||||||
syslog(LOG_ERR, "%m");
|
syslog(LOG_ERR, "%m");
|
||||||
return(0);
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* only entries with both name and line fields */
|
/* only entries with both name and line fields */
|
||||||
@ -383,8 +380,10 @@ rusers_service(rqstp, transp)
|
|||||||
if (result != NULL && !svc_sendreply(transp, xdr_result, result)) {
|
if (result != NULL && !svc_sendreply(transp, xdr_result, result)) {
|
||||||
svcerr_systemerr(transp);
|
svcerr_systemerr(transp);
|
||||||
}
|
}
|
||||||
if (!svc_freeargs(transp, xdr_argument, &argument))
|
if (!svc_freeargs(transp, xdr_argument, &argument)) {
|
||||||
errx(1, "unable to free arguments");
|
syslog(LOG_ERR, "unable to free arguments");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
leave:
|
leave:
|
||||||
if (from_inetd)
|
if (from_inetd)
|
||||||
exit(0);
|
exit(0);
|
||||||
|
@ -33,10 +33,9 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static const char rcsid[] =
|
static const char rcsid[] =
|
||||||
"$Id$";
|
"$Id: rusersd.c,v 1.6 1997/11/26 07:36:51 charnier Exp $";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <rpc/rpc.h>
|
#include <rpc/rpc.h>
|
||||||
#include <rpc/pmap_clnt.h>
|
#include <rpc/pmap_clnt.h>
|
||||||
|
Loading…
Reference in New Issue
Block a user