Download as a PDF
Transcript
*** 155,241 ****
#ifndef INADDR_LOOPBACK
#define INADDR_LOOPBACK ntohl(inet_addr("127.0.0.1"))
#endif
#endif
-
#define syslog(a,b) kandy_syslog(a, b)
#include "kandydbg.h"
int logfilefd = 0;
int kandbgfd;
int kandy_syslog(type,bufp )
int type; char *bufp; {
int len = 0;
/*
len = strlen(bufp);
write(logfilefd, bufp, len);
write(logfilefd, "\n", 1);
*/
//
//
write(logfilefd, "there was an error\n", 19);
write(logfilefd, "it shouldn't die here\n", 19);
dprintf(logfilefd, "in kandy's syslog print\n");
return len;
}
main(argc, argv)
int argc;
char **argv;
{
SVCXPRT *xprt;
int sock, c;
struct sockaddr_in addr;
int len = sizeof(struct sockaddr_in);
register struct pmaplist *pml;
- int kandret = 0;
- logfilefd =
open("/tmp/portmaplog", O_RDWR|O_CREAT|O_APPEND,
S_IRWXU);
- if (logfilefd < 0 ) {
- printf("can't open log file portmaplog\n");
- exit(1);
- }
- //write(logfilefd, "starting log file portmaplog\n", 18);
- // dprintf(logfilefd, "starting log file portmaplog\n");
43