char *cmd;
int ret;
- cmd = talloc_asprintf(mem_ctx, "fusermount -u %s\n", export);
+ cmd = talloc_asprintf(mem_ctx, "fusermount -u %s", export);
DEBUG(DEBUG_ERR,("Got SIGUSR2, unmounting fuse filesystem %s\n", export));
ret = system(cmd);
+ if (ret == -1) {
+ DEBUG(DEBUG_ERR,("system(%s) call failed : %s\n", cmd, strerror(errno)));
+ return;
+ }
+ ret = WEXITSTATUS(ret);
+ if (ret != 0) {
+ DEBUG(DEBUG_ERR,("%s failed with return code %d. Umount failed.\n", cmd, ret));
+ return;
+ }
talloc_free(mem_ctx);
_exit(10);