return -1;
}
- log_error("%s %d: new connection %d", __FUNCTION__, __LINE__, fd);
+ log_error("%s %d: new connection %d", __func__, __LINE__, fd);
if (!strlen(eid)) {
err = isns_get_ip(fd);
err = write(isns_fd, buf, length + sizeof(struct isns_hdr));
if (err < 0)
- log_error("%s %d: %s", __FUNCTION__, __LINE__, strerror(errno));
+ log_error("%s %d: %s", __func__, __LINE__, strerror(errno));
return 0;
}
err = write(isns_fd, buf, length + sizeof(struct isns_hdr));
if (err < 0)
- log_error("%s %d: %s", __FUNCTION__, __LINE__, strerror(errno));
+ log_error("%s %d: %s", __func__, __LINE__, strerror(errno));
return 0;
}
err = write(isns_fd, buf, length + sizeof(struct isns_hdr));
if (err < 0)
- log_error("%s %d: %s", __FUNCTION__, __LINE__, strerror(errno));
+ log_error("%s %d: %s", __func__, __LINE__, strerror(errno));
return 0;
}
err = write(isns_fd, buf, length + sizeof(struct isns_hdr));
if (err < 0)
- log_error("%s %d: %s", __FUNCTION__, __LINE__, strerror(errno));
+ log_error("%s %d: %s", __func__, __LINE__, strerror(errno));
return 0;
}
err = write(isns_fd, buf, length + sizeof(struct isns_hdr));
if (err < 0)
- log_error("%s %d: %s", __FUNCTION__, __LINE__, strerror(errno));
+ log_error("%s %d: %s", __func__, __LINE__, strerror(errno));
if (scn_listen_port)
isns_scn_register();
err = write(isns_fd, buf, length + sizeof(struct isns_hdr));
if (err < 0)
- log_error("%s %d: %s", __FUNCTION__, __LINE__, strerror(errno));
+ log_error("%s %d: %s", __func__, __LINE__, strerror(errno));
return 0;
}
get_hdr_param(hdr, function, length, flags, transaction, \
sequence) \
log_error("%s %d: unknown function %x %u %x %u %u", \
- __FUNCTION__, __LINE__, \
+ __func__, __LINE__, \
function, length, flags, transaction, sequence); \
}
}
log_error("%s %d: transaction not found %u",
- __FUNCTION__, __LINE__, transaction);
+ __func__, __LINE__, transaction);
return;
found:
if (status) {
log_error("%s %d: error response %u",
- __FUNCTION__, __LINE__, status);
+ __func__, __LINE__, status);
goto free_qry_mgmt;
}
if (!strlen(mgmt->name)) {
log_debug(1, "%s %d: skip %u",
- __FUNCTION__, __LINE__, transaction);
+ __func__, __LINE__, transaction);
goto free_qry_mgmt;
}
target = target_lookup_by_name(mgmt->name);
if (!target) {
log_error("%s %d: invalid tid %s",
- __FUNCTION__, __LINE__, mgmt->name);
+ __func__, __LINE__, mgmt->name);
goto free_qry_mgmt;
}
break;
case ISNS_ATTR_ISCSI_NODE_TYPE:
if (ntohl(*(tlv->value)) == ISNS_NODE_INITIATOR && name) {
- log_error("%s %d: %s", __FUNCTION__, __LINE__,
+ log_error("%s %d: %s", __func__, __LINE__,
(char *) name);
ini = malloc(sizeof(*ini));
if (!ini)
if (err) {
if (err == -EAGAIN)
return err;
- log_debug(1, "%s %d: close connection %d", __FUNCTION__, __LINE__,
+ log_debug(1, "%s %d: close connection %d", __func__, __LINE__,
isns_fd);
close(isns_fd);
isns_fd = 0;
case ISNS_FUNC_SCN:
name = print_scn_pdu(hdr);
if (name) {
- log_error("%s %d: %s", __FUNCTION__, __LINE__, name);
+ log_error("%s %d: %s", __func__, __LINE__, name);
isns_attr_query(name);
}
break;
slen = sizeof(from);
fd = accept(scn_listen_fd, (struct sockaddr *) &from, &slen);
if (fd < 0) {
- log_error("%s %d: accept error %s", __FUNCTION__, __LINE__,
+ log_error("%s %d: accept error %s", __func__, __LINE__,
strerror(errno));
return -errno;
}
err = setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt));
if (err)
- log_error("%s %d: %s\n", __FUNCTION__, __LINE__,
+ log_error("%s %d: %s\n", __func__, __LINE__,
strerror(errno));
/* not critical, so ignore. */
err = write(scn_fd, buf, length + sizeof(struct isns_hdr));
if (err < 0)
- log_error("%s %d: %s", __FUNCTION__, __LINE__, strerror(errno));
+ log_error("%s %d: %s", __func__, __LINE__, strerror(errno));
}
int isns_scn_handle(int is_accept)
uint16_t function, length, flags, transaction, sequence;
char *name = NULL;
- log_error("%s %d: %d", __FUNCTION__, __LINE__, is_accept);
+ log_error("%s %d: %d", __func__, __LINE__, is_accept);
if (is_accept)
return scn_accept_connection();
if (err) {
if (err == -EAGAIN)
return err;
- log_debug(1, "%s %d: close connection %d", __FUNCTION__, __LINE__,
+ log_debug(1, "%s %d: close connection %d", __func__, __LINE__,
scn_fd);
close(scn_fd);
scn_fd = 0;
fd = socket(ss.ss_family, SOCK_STREAM, IPPROTO_TCP);
if (fd < 0) {
- log_error("%s %d: %s\n", __FUNCTION__, __LINE__, strerror(errno));
+ log_error("%s %d: %s\n", __func__, __LINE__, strerror(errno));
return -errno;
}
if (ss.ss_family == AF_INET6) {
err = setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &opt, sizeof(opt));
if (err)
- log_error("%s %d: %s\n", __FUNCTION__, __LINE__,
+ log_error("%s %d: %s\n", __func__, __LINE__,
strerror(errno));
goto out;
}
err = listen(fd, 5);
if (err) {
- log_error("%s %d: %s\n", __FUNCTION__, __LINE__, strerror(errno));
+ log_error("%s %d: %s\n", __func__, __LINE__, strerror(errno));
goto out;
}
slen = sizeof(lss);
err = getsockname(fd, (struct sockaddr *) &lss, &slen);
if (err) {
- log_error("%s %d: %s\n", __FUNCTION__, __LINE__, strerror(errno));
+ log_error("%s %d: %s\n", __func__, __LINE__, strerror(errno));
goto out;
}
if (___unlikely(trace_flag & (trace))) { \
char *__tflag = LOG_FLAG; \
if (debug_print_prefix(trace_flag, __tflag, __LOG_PREFIX, \
- __FUNCTION__, __LINE__) > 0) { \
+ __func__, __LINE__) > 0) { \
__tflag = NO_FLAG; \
} \
PRINT(NO_FLAG, "%s" format, __tflag, args); \
do { \
if (___unlikely(trace_flag & (flag))) { \
char *__tflag = INFO_FLAG; \
- if (debug_print_prefix(trace_flag, __tflag, NULL, __FUNCTION__,\
+ if (debug_print_prefix(trace_flag, __tflag, NULL, __func__,\
__LINE__) > 0) { \
__tflag = NO_FLAG; \
} \
do { \
if (trace_flag & (trace)) { \
char *__tflag = LOG_FLAG; \
- if (debug_print_prefix(trace_flag, __tflag, NULL, __FUNCTION__,\
+ if (debug_print_prefix(trace_flag, __tflag, NULL, __func__,\
__LINE__) > 0) { \
__tflag = NO_FLAG; \
} \
do { \
if (trace_flag & TRACE_BUFF) { \
char *__tflag = LOG_FLAG; \
- if (debug_print_prefix(trace_flag, __tflag, NULL, __FUNCTION__, \
+ if (debug_print_prefix(trace_flag, __tflag, NULL, __func__, \
__LINE__) > 0) { \
__tflag = NO_FLAG; \
} \
do { \
if (trace_flag & (flag)) { \
char *__tflag = LOG_FLAG; \
- if (debug_print_prefix(trace_flag, __tflag, NULL, __FUNCTION__, \
+ if (debug_print_prefix(trace_flag, __tflag, NULL, __func__, \
__LINE__) > 0) { \
__tflag = NO_FLAG; \
} \
do { \
char *__tflag = log_flag; \
if (debug_print_prefix(trace_flag, __tflag, __LOG_PREFIX, \
- __FUNCTION__, __LINE__) > 0) { \
+ __func__, __LINE__) > 0) { \
__tflag = NO_FLAG; \
} \
PRINT(NO_FLAG, "%s" format, __tflag, args); \
if (trace_flag & TRACE_ENTRYEXIT) { \
if (trace_flag & TRACE_PID) { \
PRINT(LOG_FLAG, "[%d]: ENTRY %s", current->pid, \
- __FUNCTION__); \
+ __func__); \
} \
else { \
- PRINT(LOG_FLAG, "ENTRY %s", __FUNCTION__); \
+ PRINT(LOG_FLAG, "ENTRY %s", __func__); \
} \
} \
} while (0)
if (trace_flag & TRACE_ENTRYEXIT) { \
if (trace_flag & TRACE_PID) { \
PRINT(LOG_FLAG, "[%d]: EXIT %s", current->pid, \
- __FUNCTION__); \
+ __func__); \
} \
else { \
- PRINT(LOG_FLAG, "EXIT %s", __FUNCTION__); \
+ PRINT(LOG_FLAG, "EXIT %s", __func__); \
} \
} \
} while (0)
if (trace_flag & TRACE_ENTRYEXIT) { \
if (trace_flag & TRACE_PID) { \
PRINT(LOG_FLAG, "[%d]: EXIT %s: %ld", current->pid, \
- __FUNCTION__, (long)(res)); \
+ __func__, (long)(res)); \
} \
else { \
- PRINT(LOG_FLAG, "EXIT %s: %ld", __FUNCTION__, (long)(res)); \
+ PRINT(LOG_FLAG, "EXIT %s: %ld", __func__, (long)(res)); \
} \
} \
} while (0)
if (trace_flag & TRACE_ENTRYEXIT) { \
if (trace_flag & TRACE_PID) { \
PRINT(LOG_FLAG, "[%d]: EXIT %s: 0x%lx", current->pid, \
- __FUNCTION__, (long)(res)); \
+ __func__, (long)(res)); \
} \
else { \
- PRINT(LOG_FLAG, "EXIT %s: %lx", __FUNCTION__, (long)(res)); \
+ PRINT(LOG_FLAG, "EXIT %s: %lx", __func__, (long)(res)); \
} \
} \
} while (0)