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