diff options
Diffstat (limited to 'libmount/src/hook_mount.c')
| -rw-r--r-- | libmount/src/hook_mount.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/libmount/src/hook_mount.c b/libmount/src/hook_mount.c index c85c92b983..6b7caff853 100644 --- a/libmount/src/hook_mount.c +++ b/libmount/src/hook_mount.c @@ -70,8 +70,7 @@ static void save_fd_messages(struct libmnt_context *cxt, int fd) uint8_t buf[BUFSIZ]; int rc; - free(cxt->syscall_errmsg); - cxt->syscall_errmsg = NULL; + mnt_context_set_errmsg(cxt, NULL); while ((rc = read(fd, buf, sizeof(buf))) != -1) { if (rc > 0 && buf[rc - 1] == '\n') @@ -80,10 +79,7 @@ static void save_fd_messages(struct libmnt_context *cxt, int fd) if (rc < 3 || strncmp((char *) buf, "e ", 2) != 0) continue; - if (cxt->syscall_errmsg) - strappend(&cxt->syscall_errmsg, "; "); - - strappend(&cxt->syscall_errmsg, ((char *) buf) + 2); + mnt_context_append_errmsg(cxt, ((char *) buf) + 2); } } |
