Patches from Arne Redlich <agr@powerkom-dd.de>:
authorvlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Mon, 24 Dec 2007 10:20:18 +0000 (10:20 +0000)
committervlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Mon, 24 Dec 2007 10:20:18 +0000 (10:20 +0000)
1. The kernel's log level is a string, so strcmp needs to be used for
comparisons.

2. Svn HEAD doesn't compile against kernel versions < 2.6.19 because
"bool" had its debut only in 2.6.19. Here's a quick fix.

3. Iscsi-scstd dies with SIGPIPE if run in foreground mode because the reading
end of the init_report_pipe is already closed in this mode.

git-svn-id: https://scst.svn.sourceforge.net/svnroot/scst/trunk@238 d57e44dd-8a1f-0410-8b47-8ef2f437770f

iscsi-scst/usr/iscsi_scstd.c
scst/include/scsi_tgt.h
scst/include/scst_debug.h

index d9bacdb..2ff2747 100644 (file)
@@ -454,7 +454,10 @@ static void event_loop(int timeout)
 
        close(init_report_pipe[0]);
        res = 0;
-       write(init_report_pipe[1], &res, sizeof(res));
+
+       if (log_daemon)
+               write(init_report_pipe[1], &res, sizeof(res));
+
        close(init_report_pipe[1]);
 
        while (1) {
index 4f25a7e..58e9f4c 100644 (file)
 
 #include <scst_const.h>
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
+typedef _Bool bool;
+#endif
+
 /* Version numbers, the same as for the kernel */
 #define SCST_VERSION_CODE 0x000906
 #define SCST_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
index 995dae1..037d43d 100644 (file)
@@ -282,7 +282,7 @@ do {                                                                \
 
 #define PRINT_ERROR(format, args...)                               \
 do {                                                                \
-  if (ERROR_FLAG != LOG_FLAG)                                       \
+  if (strcmp(ERROR_FLAG, LOG_FLAG))                                 \
   {                                                                 \
     PRINT_LOG_FLAG(LOG_FLAG, "***ERROR*** " format, args);          \
   }                                                                 \
@@ -291,7 +291,7 @@ do {                                                                \
 
 #define PRINT_INFO(format, args...)                   \
 do {                                                  \
-  if (INFO_FLAG != LOG_FLAG)                          \
+  if (strcmp(INFO_FLAG, LOG_FLAG))                    \
   {                                                   \
     PRINT_LOG_FLAG(LOG_FLAG, format, args);           \
   }                                                   \