+ if (asprintf(&tmp, "%s/%u_%lld/%s", trace_path, buf->pid, buf->pidunique, buf->name) < 0) {
+ ERR("on_open_buffer : asprintf failed (%s/%u_%lld/%s)",
+ trace_path, buf->pid, buf->pidunique, buf->name);
+ return 1;
+ }
+ result = fd = open(tmp, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, 00600);
+ if(result == -1) {
+ PERROR("open");
+ ERR("failed opening trace file %s", tmp);
+ return 1;
+ }
+ buf_local->file_fd = fd;
+ free(tmp);