Skip to content

Commit

Permalink
quiet analyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Dec 26, 2024
1 parent 770ab98 commit c51b045
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/util/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,10 @@ ssize_t fr_touch(int *fd_out, char const *filename, mode_t mode, bool mkdir, mod
char *q;

if (mkdir && (errno == ENOENT) && (q = strrchr(filename, FR_DIR_SEP))) {
int dir_fd;
int dir_fd = -1;

slen = fr_mkdir(&dir_fd, filename, q - filename, dir_mode, NULL, NULL);
if (slen <= 0) return slen;
if((slen <= 0) || (dir_fd < 0)) return slen;

fd = openat(dir_fd, q + 1, O_WRONLY | O_CREAT, mode);
if (fd >= 0) {
Expand Down

0 comments on commit c51b045

Please sign in to comment.