From 492e33a3125de09516573b72bd8d1e86196b1ce0 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Sat, 17 Jul 2010 16:44:22 +0000 Subject: [PATCH] - Move nl_open() after kernel_open() to avoid issues when second start could skrew netlink states for the first instance - Avoid compiler warn_unused_result warning git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1837 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/usr/iscsi_scstd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/iscsi-scst/usr/iscsi_scstd.c b/iscsi-scst/usr/iscsi_scstd.c index babb6bfb7..acde70c97 100644 --- a/iscsi-scst/usr/iscsi_scstd.c +++ b/iscsi-scst/usr/iscsi_scstd.c @@ -495,7 +495,7 @@ static void event_loop(void) res = 0; if (log_daemon) - write(init_report_pipe[1], &res, sizeof(res)); + res = write(init_report_pipe[1], &res, sizeof(res)); close(init_report_pipe[1]); @@ -696,16 +696,16 @@ int main(int argc, char **argv) } } - if ((nl_fd = nl_open()) < 0) { - perror("netlink open failed"); - exit(-1); - }; - if ((ctrl_fd = kernel_open()) < 0) exit(-1); init_max_params(); + if ((nl_fd = nl_open()) < 0) { + perror("netlink open failed"); + exit(-1); + }; + #ifndef CONFIG_SCST_PROC err = kernel_attr_add(NULL, ISCSI_ISNS_SERVER_ATTR_NAME, S_IRUSR|S_IRGRP|S_IROTH|S_IWUSR, 0);