mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-31 07:11:09 -04:00
notify: add_icon(): check return value of write()
This commit is contained in:
parent
9814cf5779
commit
d0a5425155
1 changed files with 7 additions and 4 deletions
11
notify.c
11
notify.c
|
|
@ -303,11 +303,14 @@ add_icon(struct notification_icon *icon, const char *id, const char *symbolic_na
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
write(fd, data, data_sz);
|
if (write(fd, data, data_sz) != (ssize_t)data_sz) {
|
||||||
close(fd);
|
LOG_ERRNO("failed to write icon data to temporary file");
|
||||||
|
} else {
|
||||||
|
LOG_DBG("wrote icon data to %s", name);
|
||||||
|
icon->tmp_file_on_disk = xstrdup(name);
|
||||||
|
}
|
||||||
|
|
||||||
LOG_DBG("wrote icon data to %s", name);
|
close(fd);
|
||||||
icon->tmp_file_on_disk = xstrdup(name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_DBG("added icon to cache: ID=%s: sym=%s, file=%s",
|
LOG_DBG("added icon to cache: ID=%s: sym=%s, file=%s",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue