Rename DEBUG macro to TFTP_DEBUG, to be more consistent with

debug macros in other files.
This commit is contained in:
Craig Rodrigues 2011-05-03 07:46:02 +00:00
parent 3eb882f031
commit 51f95b0a42

View File

@ -148,14 +148,14 @@ recvtftp(struct iodesc *d, void *pkt, ssize_t len, time_t tleft)
printf("illegal tftp error %d\n", ntohs(t->th_code)); printf("illegal tftp error %d\n", ntohs(t->th_code));
errno = EIO; errno = EIO;
} else { } else {
#ifdef DEBUG #ifdef TFTP_DEBUG
printf("tftp-error %d\n", ntohs(t->th_code)); printf("tftp-error %d\n", ntohs(t->th_code));
#endif #endif
errno = tftperrors[ntohs(t->th_code)]; errno = tftperrors[ntohs(t->th_code)];
} }
return (-1); return (-1);
default: default:
#ifdef DEBUG #ifdef TFTP_DEBUG
printf("tftp type %d not handled\n", ntohs(t->th_opcode)); printf("tftp type %d not handled\n", ntohs(t->th_opcode));
#endif #endif
return (-1); return (-1);
@ -303,7 +303,7 @@ tftp_read(struct open_file *f, void *addr, size_t size,
res = tftp_getnextblock(tftpfile); res = tftp_getnextblock(tftpfile);
if (res) { /* no answer */ if (res) { /* no answer */
#ifdef DEBUG #ifdef TFTP_DEBUG
printf("tftp: read error\n"); printf("tftp: read error\n");
#endif #endif
return (res); return (res);
@ -319,7 +319,7 @@ tftp_read(struct open_file *f, void *addr, size_t size,
inbuffer = tftpfile->validsize - offinblock; inbuffer = tftpfile->validsize - offinblock;
if (inbuffer < 0) { if (inbuffer < 0) {
#ifdef DEBUG #ifdef TFTP_DEBUG
printf("tftp: invalid offset %d\n", printf("tftp: invalid offset %d\n",
tftpfile->off); tftpfile->off);
#endif #endif
@ -336,7 +336,7 @@ tftp_read(struct open_file *f, void *addr, size_t size,
if ((tftpfile->islastblock) && (count == inbuffer)) if ((tftpfile->islastblock) && (count == inbuffer))
break; /* EOF */ break; /* EOF */
} else { } else {
#ifdef DEBUG #ifdef TFTP_DEBUG
printf("tftp: block %d not found\n", needblock); printf("tftp: block %d not found\n", needblock);
#endif #endif
return (EINVAL); return (EINVAL);