From: Neil Brown Date: Fri, 20 Apr 2007 02:41:29 +0000 (+1000) Subject: Remove #define of perror. X-Git-Tag: portmap_6.0~29 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=7ab39c464f3120eb005230930b1abb3b55b3065c;p=portmap.git Remove #define of perror. 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. --- diff --git a/Makefile b/Makefile index 3f7cb21..6fad7dc 100644 --- a/Makefile +++ b/Makefile @@ -99,14 +99,14 @@ AUX = daemon.o strerror.o # 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) diff --git a/from_local.c b/from_local.c index 3f64405..c9b8a0a 100644 --- a/from_local.c +++ b/from_local.c @@ -39,10 +39,6 @@ static char sccsid[] = "@(#) from_local.c 1.3 96/05/31 15:52:57"; #endif -#ifdef TEST -#undef perror -#endif - #include #include #include diff --git a/pmap_dump.8 b/pmap_dump.8 new file mode 100644 index 0000000..e69de29 diff --git a/pmap_dump.c b/pmap_dump.c index 2bddcbb..3d73592 100644 --- a/pmap_dump.c +++ b/pmap_dump.c @@ -42,7 +42,6 @@ char **argv; list->pml_map.pm_port, rpc ? rpc->r_name : ""); } -#undef perror return (fclose(stdout) ? (perror(argv[0]), 1) : 0); } diff --git a/pmap_set.8 b/pmap_set.8 new file mode 100644 index 0000000..e69de29 diff --git a/portmap.8 b/portmap.8 new file mode 100644 index 0000000..e69de29 diff --git a/portmap.c b/portmap.c index 65a26d2..a67779a 100644 --- a/portmap.c +++ b/portmap.c @@ -291,16 +291,12 @@ main(argc, argv) 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)