#include "lfs_project.h"
#include <lustre/lustreapi.h>
+const char *progname;
+
struct lfs_project_item {
struct list_head lpi_list;
- char lpi_pathname[PATH_MAX];
+ char *lpi_pathname;
};
static int
return -ENOMEM;
}
- strncpy(lpi->lpi_pathname, pathname, sizeof(lpi->lpi_pathname) - 1);
- list_add_tail(&lpi->lpi_list, head);
+ lpi->lpi_pathname = strdup(pathname);
+ if (!lpi->lpi_pathname) {
+ free(lpi);
+ return -ENOMEM;
+ } else
+ list_add_tail(&lpi->lpi_list, head);
return 0;
}
phc, func);
if (!ret && rc)
ret = rc;
+ free(lpi->lpi_pathname);
free(lpi);
}