From a97b51bbe5a61101bb9bc0a2f940c6e5a7e8cac1 Mon Sep 17 00:00:00 2001 From: Peter Lieven Date: Wed, 7 Nov 2012 06:45:54 +0100 Subject: [PATCH] Revert "DEBUG add function to set debug fd" We will have a completely different debugging framework soon. This reverts commit ec46d6fa43e33d3cc943fc28d09045a006eb4bac. --- include/iscsi-private.h | 3 +-- include/iscsi.h | 14 ++++---------- lib/init.c | 12 ------------ lib/libiscsi.def | 1 - lib/libiscsi.syms | 1 - 5 files changed, 5 insertions(+), 26 deletions(-) diff --git a/include/iscsi-private.h b/include/iscsi-private.h index 1250dec..5655d9e 100644 --- a/include/iscsi-private.h +++ b/include/iscsi-private.h @@ -130,7 +130,6 @@ struct iscsi_context { int no_auto_reconnect; int reconnect_deferred; int debug; - int debug_fd; int mallocs; int reallocs; int frees; @@ -305,7 +304,7 @@ struct scsi_task *iscsi_scsi_get_task_from_pdu(struct iscsi_pdu *pdu); void iscsi_set_noautoreconnect(struct iscsi_context *iscsi, int state); -void iscsi_decrement_iface_rr(void); +void iscsi_decrement_iface_rr(); #ifdef __cplusplus } diff --git a/include/iscsi.h b/include/iscsi.h index d8c67f2..fde65c8 100644 --- a/include/iscsi.h +++ b/include/iscsi.h @@ -971,12 +971,12 @@ iscsi_scsi_cancel_all_tasks(struct iscsi_context *iscsi); #define DPRINTF(iscsi,level,fmt,args...) \ do { \ if ((iscsi)->debug >= level) { \ - dprintf((iscsi)->debug_fd,"libiscsi: "); \ - dprintf((iscsi)->debug_fd, (fmt), ##args); \ + fprintf(stderr,"libiscsi: "); \ + fprintf(stderr, (fmt), ##args); \ if (iscsi->target_name[0]) { \ - dprintf((iscsi)->debug_fd," [%s]",iscsi->target_name); \ + fprintf(stderr," [%s]",iscsi->target_name); \ } \ - dprintf((iscsi)->debug_fd,"\n"); \ + fprintf(stderr,"\n"); \ } \ } while (0); @@ -993,12 +993,6 @@ iscsi_scsi_cancel_all_tasks(struct iscsi_context *iscsi); EXTERN void iscsi_set_debug(struct iscsi_context *iscsi, int level); -/* - * This function is to set fd where debugging info is sent to. default is stderr (2) - */ -EXTERN void -iscsi_set_debug_fd(struct iscsi_context *iscsi, int fd); - /* * This function is to set the TCP_USER_TIMEOUT option. It has to be called after iscsi * context creation. The value given in ms is then applied each time a new socket is created. diff --git a/lib/init.c b/lib/init.c index 1464916..143cf9b 100644 --- a/lib/init.c +++ b/lib/init.c @@ -87,7 +87,6 @@ iscsi_create_context(const char *initiator_name) strncpy(iscsi->initiator_name,initiator_name,MAX_STRING_SIZE); iscsi->fd = -1; - iscsi->debug_fd = 2; srand(time(NULL) ^ getpid() ^ (u_int32_t) iscsi); @@ -113,10 +112,6 @@ iscsi_create_context(const char *initiator_name) iscsi->tcp_keepintvl=30; iscsi->tcp_keepidle=30; - if (getenv("LIBISCSI_DEBUG_FD") != NULL) { - iscsi_set_debug_fd(iscsi,atoi(getenv("LIBISCSI_DEBUG_FD"))); - } - if (getenv("LIBISCSI_DEBUG") != NULL) { iscsi_set_debug(iscsi,atoi(getenv("LIBISCSI_DEBUG"))); } @@ -320,13 +315,6 @@ iscsi_set_debug(struct iscsi_context *iscsi, int level) DPRINTF(iscsi,2,"set debug level to %d",level); } -void -iscsi_set_debug_fd(struct iscsi_context *iscsi, int fd) -{ - iscsi->debug_fd = fd; - DPRINTF(iscsi,2,"set debug fd to %d",fd); -} - const char * iscsi_get_error(struct iscsi_context *iscsi) { diff --git a/lib/libiscsi.def b/lib/libiscsi.def index 3f38d87..95f4552 100644 --- a/lib/libiscsi.def +++ b/lib/libiscsi.def @@ -65,7 +65,6 @@ iscsi_scsi_task_cancel iscsi_service iscsi_set_alias iscsi_set_debug -iscsi_set_debug_fd iscsi_set_header_digest iscsi_set_initiator_username_pwd iscsi_set_isid_en diff --git a/lib/libiscsi.syms b/lib/libiscsi.syms index 5129d9c..4eaeb67 100644 --- a/lib/libiscsi.syms +++ b/lib/libiscsi.syms @@ -63,7 +63,6 @@ iscsi_scsi_task_cancel iscsi_service iscsi_set_alias iscsi_set_debug -iscsi_set_debug_fd iscsi_set_header_digest iscsi_set_initiator_username_pwd iscsi_set_isid_en