On Thu, Sep 8, 2011 at 2:26 PM, Aastha Mehta <[email protected]> wrote:
> Sorry, please ignore the previous patch. There was some minor error in that.
> Re-attaching the patch here.
+#include<stdio.h>
+#include<stdlib.h>
+#include<string.h>
+#include "iscsi_if.h"
+#include"kern_error_table.h"
+#define NUM_ERRORS 22
You can probably clean up the includes, and the #define.
+ log_warning("error %d: %s ", error, err_desc);
Maybe do:
log_warning("error %d: %s ", error, err_code_to_string(error);
+ switch(code % ISCSI_ERR_BASE){
+ case 0: return "ISCSI_OK: operation successful";
+ case 1: return "ISCSI_ERR_DATASN: Received invalid
data sequence
number from target";
Since you are returning the error strings here directly, you don't need
"code % ISCSI_ERR_BASE" and can use ISCSI_ERR_* enum values
in the case statements directly. That would be clearer than using just
numbers.
+ default: return "Invalid error code. Is there a new error code
added which is not handled?";
"Invalid" or "Unknown" ? This is probably nitpicking :/
-Ankit
--
You received this message because you are subscribed to the Google Groups
"open-iscsi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/open-iscsi?hl=en.