This patch ensures that if __tool_init fails, we don't sleep and retry if the tool is iprconfig. We only want to do this for the ipr daemons.
Signed-off-by: Brian King <brk...@linux.vnet.ibm.com> --- iprconfig.c | 1 + iprlib.c | 3 ++- iprlib.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff -puN iprlib.c~iprutils_iprconfig_nowait iprlib.c --- iprutils.patched/iprlib.c~iprutils_iprconfig_nowait 2016-10-25 13:50:49.783496463 -0500 +++ iprutils.patched-bjking1/iprlib.c 2016-10-25 13:50:49.796496409 -0500 @@ -35,6 +35,7 @@ int ipr_fast = 0; int format_done = 0; static int ipr_mode5_write_buffer = 0; static int first_time_check_zeroed_dev = 0; +int tool_init_retry = 1; struct sysfs_dev *head_zdev = NULL; struct sysfs_dev *tail_zdev = NULL; @@ -2220,7 +2221,7 @@ int tool_init(int save_state) for (i = 0; i < 4 && rc_err == -EAGAIN; i++) { rc_err = __tool_init(save_state); - if (rc_err == -EAGAIN) + if (rc_err == -EAGAIN && tool_init_retry) sleep(2); } if (rc_err) { diff -puN iprlib.h~iprutils_iprconfig_nowait iprlib.h --- iprutils.patched/iprlib.h~iprutils_iprconfig_nowait 2016-10-25 13:50:49.786496451 -0500 +++ iprutils.patched-bjking1/iprlib.h 2016-10-25 13:50:49.797496404 -0500 @@ -296,6 +296,7 @@ extern char *tool_name; extern struct sysfs_dev *head_zdev; extern struct sysfs_dev *tail_zdev; extern enum system_p_mode power_cur_mode; +extern int tool_init_retry; struct sysfs_dev { u64 device_id; diff -puN iprconfig.c~iprutils_iprconfig_nowait iprconfig.c --- iprutils.patched/iprconfig.c~iprutils_iprconfig_nowait 2016-10-25 13:50:49.789496438 -0500 +++ iprutils.patched-bjking1/iprconfig.c 2016-10-25 13:50:49.800496392 -0500 @@ -19442,6 +19442,7 @@ int main(int argc, char *argv[]) char parm_editor[200], parm_dir[200], cmd[200]; int non_intenactive = 0; + tool_init_retry = 0; strcpy(parm_dir, DEFAULT_LOG_DIR); strcpy(parm_editor, DEFAULT_EDITOR); _ ------------------------------------------------------------------------------ The Command Line: Reinvented for Modern Developers Did the resurgence of CLI tooling catch you by surprise? Reconnect with the command line and become more productive. Learn the new .NET and ASP.NET CLI. Get your free copy! http://sdm.link/telerik _______________________________________________ Iprdd-devel mailing list Iprdd-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/iprdd-devel