Original code defined a new perror to send error messages via
syslog so that perror calls in the rpc library would be redefined as well,
and the had -Dperror=xperror in the Makefile to override this.
Debian and Fedora just removed the "-Dperror=.."
SuSE fixed up problems by adding some more "#undef perror".
I have taken the Debian/Fedora approach and tidied up related bits of code.
# Comment out if your compiler talks ANSI and understands const
#
-CONST = -Dconst=
+# CONST = -Dconst=
### End of configurable stuff.
##############################
SHELL = /bin/sh
-COPT = $(CONST) -Dperror=xperror $(HOSTS_ACCESS) $(CHECK_PORT) \
+COPT = $(CONST) $(HOSTS_ACCESS) $(CHECK_PORT) \
$(SYS) -DFACILITY=$(FACILITY) $(ULONG) $(ZOMBIES) $(SA_LEN) \
$(LOOPBACK) $(SETPGRP)
CFLAGS = $(COPT) -O $(NSARCHS)
static char sccsid[] = "@(#) from_local.c 1.3 96/05/31 15:52:57";
#endif
-#ifdef TEST
-#undef perror
-#endif
-
#include <sys/types.h>
#include <sys/socket.h>
#include <stdio.h>
list->pml_map.pm_port,
rpc ? rpc->r_name : "");
}
-#undef perror
return (fclose(stdout) ? (perror(argv[0]), 1) : 0);
}
abort();
}
-#ifndef lint
/* need to override perror calls in rpc library */
-void
-perror(what)
- const char *what;
+void perror(const char *what)
{
syslog(LOG_ERR, "%s: %m", what);
}
-#endif
static struct pmaplist *
find_service(prog, vers, prot)