int len;
int maxfd;
+ LOG(log_maxdebug, logtype_dsi, "dsi_buffer: switching to non-blocking IO");
+
/* non blocking mode */
if (setnonblock(dsi->socket, 1) < 0) {
/* can't do it! exit without error it will sleep to death below */
break;
}
}
+
+ LOG(log_maxdebug, logtype_dsi, "dsi_buffer: switching back to blocking IO");
+
if (setnonblock(dsi->socket, 0) < 0) {
/* can't do it! afpd will fail very quickly */
LOG(log_error, logtype_dsi, "dsi_buffer: ioctl blocking mode %s", strerror(errno));
dsi->in_write++;
written = 0;
+
+ LOG(log_maxdebug, logtype_dsi, "dsi_stream_write: sending %u bytes", length);
+
while (written < length) {
len = send(dsi->socket, (u_int8_t *) data + written, length - written, flags);
if ((len == 0) || (len == -1 && errno == EINTR))
0: set ?
0: syslog ?
-1: logfiles fd
- log_maxdebug: force first LOG call to call make_log_entry which
- then calls log_init because "inited" is still 0
+ log_none: no logging by default
0: Display options */
-#define DEFAULT_LOG_CONFIG {0, 0, -1, log_maxdebug, 0}
+#define DEFAULT_LOG_CONFIG {0, 0, -1, log_none, 0}
UAM_MODULE_EXPORT logtype_conf_t type_configs[logtype_end_of_list_marker] = {
DEFAULT_LOG_CONFIG, /* logtype_default */
process_uid = geteuid();
if (process_uid) {
if (seteuid(OPEN_LOGS_AS_UID) == -1) {
- /* XXX failing silently */
- return;
+ process_uid = 0;
}
}
type_configs[logtype].fd = open(filename,
unsetuplog("Default");
#endif
/* filelog testing */
- setuplog("Default LOG_INFO test.log");
- LOG(log_info, logtype_logger, "This should log.");
- LOG(log_info, logtype_default, "This should log.");
- LOG(log_error, logtype_logger, "This should log.");
- LOG(log_error, logtype_default, "This should log.");
- LOG(log_debug, logtype_logger, "This should not log.");
- LOG(log_debug, logtype_default, "This should not log.");
-
- LOG(log_severe, logtype_logger, "Logging Test finishing");
+
+ setuplog("DSI log_maxdebug test.log");
+ LOG(log_info, logtype_dsi, "This should log.");
+ LOG(log_error, logtype_default, "This should not log.");
+
+ setuplog("Default log_debug test.log");
+ LOG(log_debug, logtype_default, "This should log.");
+ LOG(log_maxdebug, logtype_default, "This should not log.");
+
+ LOG(log_maxdebug, logtype_dsi, "This should still log.");
return 0;
}