commit
565d38c5af
|
@ -44,10 +44,7 @@ int mkdirp(const char *path, mode_t mode) {
|
|||
|
||||
char *sep = strrchr(copy, '/');
|
||||
if (sep == NULL) {
|
||||
if (copy != NULL) {
|
||||
free(copy);
|
||||
copy = NULL;
|
||||
}
|
||||
free(copy);
|
||||
return -1;
|
||||
}
|
||||
*sep = '\0';
|
||||
|
|
|
@ -70,7 +70,7 @@ ssize_t writeall(int fd, const void *buf, size_t count) {
|
|||
size_t written = 0;
|
||||
|
||||
while (written < count) {
|
||||
const ssize_t n = write(fd, buf + written, count - written);
|
||||
const ssize_t n = write(fd, ((char *)buf) + written, count - written);
|
||||
if (n == -1) {
|
||||
if (errno == EINTR || errno == EAGAIN)
|
||||
continue;
|
||||
|
@ -86,7 +86,7 @@ ssize_t writeall_nonblock(int fd, const void *buf, size_t count) {
|
|||
size_t written = 0;
|
||||
|
||||
while (written < count) {
|
||||
const ssize_t n = write(fd, buf + written, count - written);
|
||||
const ssize_t n = write(fd, ((char *)buf) + written, count - written);
|
||||
if (n == -1) {
|
||||
if (errno == EAGAIN) {
|
||||
return written;
|
||||
|
|
Loading…
Reference in New Issue