ret = run_as_mkdir(fullpath, S_IRWXU | S_IRWXG, uid, gid);
if (ret < 0) {
if (ret != -EEXIST) {
- ERR("Index trace directory creation error");
+ PERROR("Index trace directory creation error");
goto error;
}
}
{
ssize_t ret;
- assert(fd >= 0);
assert(index);
+ if (fd < 0) {
+ ret = -EINVAL;
+ goto error;
+ }
+
ret = lttng_write(fd, index, len);
if (ret < len) {
PERROR("writing index file");
}
+error:
return ret;
}