Module: xenomai-3
Branch: next
Commit: fd77cbe8b14bbfff8892ae07bbd311e001bed3da
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=fd77cbe8b14bbfff8892ae07bbd311e001bed3da

Author: Philippe Gerum <r...@xenomai.org>
Date:   Fri Apr 22 14:03:32 2016 +0200

copperplate/sysregd: fix fall back path to umount

---

 lib/copperplate/regd/regd.c |   21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/lib/copperplate/regd/regd.c b/lib/copperplate/regd/regd.c
index 5d69d83..e0228fb 100644
--- a/lib/copperplate/regd/regd.c
+++ b/lib/copperplate/regd/regd.c
@@ -276,18 +276,17 @@ static void unmount(const char *path)
                fcntl(2, F_SETFD, flags | FD_CLOEXEC);
 
        cmdpath = lookup_command("fusermount");
-       if (cmdpath == NULL)
-               return;
-
-       ret = asprintf(&cmd, "%s -uzq %s", cmdpath, path);
-       free(cmdpath);
-       if (ret < 0)
-               return;
+       if (cmdpath) {
+               ret = asprintf(&cmd, "%s -uzq %s", cmdpath, path);
+               free(cmdpath);
+               if (ret < 0)
+                       return;
 
-       ret = system(cmd);
-       free(cmd);
-       if (ret != -1 && WIFEXITED(ret) && WEXITSTATUS(ret) == 0)
-               return;
+               ret = system(cmd);
+               free(cmd);
+               if (ret != -1 && WIFEXITED(ret) && WEXITSTATUS(ret) == 0)
+                       return;
+       }
 
        cmdpath = lookup_command("umount");
        if (cmdpath == NULL)


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to