Imported Upstream version 0.6.1
[platform/upstream/multipath-tools.git] / libmultipath / callout.c
index ae19051..d671b0c 100644 (file)
@@ -77,7 +77,7 @@ int execute_program(char *path, char *value, int len)
                null_fd = open("/dev/null", O_WRONLY);
                if (null_fd > 0) {
                        close(STDERR_FILENO);
-                       dup(null_fd);
+                       retval = dup(null_fd);
                        close(null_fd);
                }
 
@@ -125,7 +125,7 @@ int execute_program(char *path, char *value, int len)
                        if (status == 0)
                                retval = 0;
                        else
-                               condlog(0, "%s exitted with %d", argv[0], status);
+                               condlog(0, "%s exited with %d", argv[0], status);
                }
                else if (WIFSIGNALED(status))
                        condlog(0, "%s was terminated by signal %d", argv[0], WTERMSIG(status));
@@ -201,8 +201,10 @@ apply_format (char * string, char * cmd, struct path * pp)
        }
        pos++;
 
-       if (!*pos)
+       if (!*pos) {
+               condlog(3, "formatted callout = %s", dst);
                return 0;
+       }
 
        len = strlen(pos) + 1;
        myfree -= len;
@@ -211,7 +213,6 @@ apply_format (char * string, char * cmd, struct path * pp)
                return 1;
 
        snprintf(p, len, "%s", pos);
-       condlog(3, "reformated callout = %s", dst);
+       condlog(3, "reformatted callout = %s", dst);
        return 0;
 }
-