]> git.neil.brown.name Git - portmap.git/commitdiff
Remove #define of perror.
authorNeil Brown <neilb@notabene.brown>
Fri, 20 Apr 2007 02:41:29 +0000 (12:41 +1000)
committerNeil Brown <neilb@notabene.brown>
Fri, 20 Apr 2007 02:41:29 +0000 (12:41 +1000)
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.

Makefile
from_local.c
pmap_dump.8 [new file with mode: 0644]
pmap_dump.c
pmap_set.8 [new file with mode: 0644]
portmap.8 [new file with mode: 0644]
portmap.c

index 3f7cb21da91f1123f90c0120eaa28f2bc495d63a..6fad7dc829d0db6060ba7fa13753a16cdc6e35ef 100644 (file)
--- 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)
index 3f64405785afa53b12914ee90782aa33131ac2b2..c9b8a0a4d03ad9c878bf41a8c151270d43b3bf35 100644 (file)
 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>
diff --git a/pmap_dump.8 b/pmap_dump.8
new file mode 100644 (file)
index 0000000..e69de29
index 2bddcbbee069036fb1e3e5617c9fcc9c4d54c353..3d7359287f1e3cbd61617027c843180cf7f5c5cc 100644 (file)
@@ -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 (file)
index 0000000..e69de29
diff --git a/portmap.8 b/portmap.8
new file mode 100644 (file)
index 0000000..e69de29
index 65a26d224e947c4c07adc4e2babe6f3bccf0f4cb..a67779a4607edab5286c156320d904016538ba8e 100644 (file)
--- 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)