Whamcloud - gitweb
LU-1270 utils: properly initialize traverse param
[fs/lustre-release.git] / lustre / utils / liblustreapi.c
index bb1c0b6..4404fae 100644 (file)
@@ -1130,10 +1130,11 @@ static int common_param_init(struct find_param *param, char *path)
                 return -ENOMEM;
         }
 
-        param->got_uuids = 0;
-        param->obdindexes = NULL;
-        param->obdindex = OBD_NOT_FOUND;
-        return 0;
+       param->got_uuids = 0;
+       param->obdindexes = NULL;
+       param->obdindex = OBD_NOT_FOUND;
+       param->mdtindex = OBD_NOT_FOUND;
+       return 0;
 }
 
 static void find_param_fini(struct find_param *param)
@@ -3111,6 +3112,7 @@ static int rmtacl_notify(int ops)
                 }
 
                 rc = ioctl(fd, LL_IOC_RMTACL, ops);
+               close(fd);
                 if (rc < 0) {
                         rc = -errno;
                         llapi_error(LLAPI_MSG_ERROR, rc, "ioctl %d\n", fd);
@@ -3122,8 +3124,6 @@ static int rmtacl_notify(int ops)
 
 out:
         endmntent(fp);
-       if (fd >= 0)
-               close(fd);
        return ((rc != 0) ? rc : found);
 }