Whamcloud - gitweb
b=19720
authorbrian <brian>
Wed, 9 Sep 2009 20:03:59 +0000 (20:03 +0000)
committerbrian <brian>
Wed, 9 Sep 2009 20:03:59 +0000 (20:03 +0000)
i=adilger

Clean up various warnings stemming from unused variables and unchecked
function return values.

lnet/include/libcfs/darwin/darwin-prim.h
lnet/include/libcfs/winnt/winnt-prim.h
lnet/libcfs/linux/linux-debug.c
lnet/selftest/selftest.h
lnet/utils/debug.c
lnet/utils/lstclient.c

index 1e5f639..b0bec96 100644 (file)
@@ -473,7 +473,7 @@ struct __dummy_ ## name ## _struct {}
 #define inter_module_get(n)                    cfs_symbol_get(n)
 #define inter_module_put(n)                    cfs_symbol_put(n)
 
-static inline int request_module(char *name)
+static inline int request_module(const char *name, ...)
 {
        return (-EINVAL);
 }
index 4b25e87..a980556 100644 (file)
@@ -555,7 +555,7 @@ void sleep_on(cfs_waitq_t *waitq);
 #define __init
 #endif
 
-#define request_module(x) (0)
+#define request_module(x, y) (0)
 
 #define EXPORT_SYMBOL(s)
 #define MODULE_AUTHOR(s)
index 90b0dd9..7ff51d1 100644 (file)
@@ -213,7 +213,7 @@ void lbug_with_loc(const char *file, const char *func, const int line)
 static void
 print_trace_warning_symbol(void *data, char *msg, unsigned long symbol)
 {
-       printk(data);
+        printk("%s", (char *)data);
        print_symbol(msg, symbol);
        printk("\n");
 }
index 7c9bc8c..2f0c34a 100644 (file)
@@ -448,6 +448,7 @@ void sfw_unpack_message(srpc_msg_t *msg);
 void sfw_free_pages(srpc_server_rpc_t *rpc);
 void sfw_add_bulk_page(srpc_bulk_t *bk, cfs_page_t *pg, int i);
 int sfw_alloc_pages(srpc_server_rpc_t *rpc, int npages, int sink);
+int sfw_make_session (srpc_mksn_reqst_t *request, srpc_mksn_reply_t *reply);
 
 srpc_client_rpc_t *
 srpc_create_client_rpc(lnet_process_id_t peer, int service,
index 973cac0..1a70a28 100644 (file)
@@ -366,15 +366,22 @@ static void print_rec(struct dbg_line ***linevp, int used, int fdout)
                 struct dbg_line *line = linev[i];
                 struct ptldebug_header *hdr = line->hdr;
                 char out[4097];
+                char *buf = out;
                 int bytes;
+                ssize_t bytes_written;
 
                 bytes = sprintf(out, "%08x:%08x:%u:%u.%06llu:%u:%u:%u:(%s:%u:%s()) %s",
                                 hdr->ph_subsys, hdr->ph_mask, hdr->ph_cpu_id,
                                 hdr->ph_sec, (unsigned long long)hdr->ph_usec,
                                 hdr->ph_stack, hdr->ph_pid, hdr->ph_extern_pid,
                                 line->file, hdr->ph_line_num, line->fn, line->text);
-
-                write(fdout, out, bytes);
+                while (bytes > 0) {
+                        bytes_written = write(fdout, buf, bytes);
+                        if (bytes_written <= 0)
+                                break;
+                        bytes -= bytes_written;
+                        buf += bytes_written;
+                }
                 free(line->hdr);
                 free(line);
         }
@@ -631,7 +638,8 @@ int jt_dbg_debug_kernel(int argc, char **argv)
                 return 1;
         }
         if (argc > 1) {
-                fdout = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC);
+                fdout = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC,
+                             S_IRUSR | S_IWUSR);
                 if (fdout < 0) {
                         fprintf(stderr, "fopen(%s) failed: %s\n", argv[1],
                                 strerror(errno));
index a439645..26a05c9 100644 (file)
@@ -186,13 +186,13 @@ main(int argc, char **argv)
                         server_mode_flag = 1;
                         break;
                 default:
-                        fprintf(stderr, usage_string);
+                        fprintf(stderr, "%s", usage_string);
                         return -1;
                 }
         }
 
         if (optind != argc || grp == NULL || ses == NULL) {
-                fprintf(stderr, usage_string);
+                fprintf(stderr, "%s", usage_string);
                 return -1;
         }