]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
better naming for mmap helpers 926/head
authorChristian Brauner <christian.brauner@mailbox.org>
Tue, 29 Mar 2016 06:50:27 +0000 (08:50 +0200)
committerChristian Brauner <christian.brauner@mailbox.org>
Tue, 29 Mar 2016 06:50:27 +0000 (08:50 +0200)
Rename lxc_mmap()/lxc_munmap() to lxc_strmmap()/lxc_strmunmap().

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
src/lxc/lxccontainer.c
src/lxc/utils.c
src/lxc/utils.h

index 8e2f41356b7a088160d8fdcee0aa040a838a9724..f5a44d078d77255b088ae25e182aa4bd990c22e2 100644 (file)
@@ -2164,7 +2164,7 @@ static bool mod_rdep(struct lxc_container *c0, struct lxc_container *c, bool inc
 
                        if (fbuf.st_size != 0) {
 
-                               buf = lxc_mmap(NULL, fbuf.st_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+                               buf = lxc_strmmap(NULL, fbuf.st_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
                                if (buf == MAP_FAILED) {
                                        SYSERROR("Failed to create mapping %s", path);
                                        close(fd);
@@ -2177,7 +2177,7 @@ static bool mod_rdep(struct lxc_container *c0, struct lxc_container *c, bool inc
                                        bytes += len;
                                }
 
-                               lxc_munmap(buf, fbuf.st_size);
+                               lxc_strmunmap(buf, fbuf.st_size);
                                if (ftruncate(fd, fbuf.st_size - bytes) < 0) {
                                        SYSERROR("Failed to truncate file %s", path);
                                        close(fd);
index 98ea0667dfece20e2ca1cdb391409a5dcfee5c9f..ba20c43df0f82e4c2db83e30f2b4bd02f5a76a5e 100644 (file)
@@ -1812,8 +1812,8 @@ int lxc_count_file_lines(const char *fn)
        return n;
 }
 
-void *lxc_mmap(void *addr, size_t length, int prot, int flags, int fd,
-              off_t offset)
+void *lxc_strmmap(void *addr, size_t length, int prot, int flags, int fd,
+                 off_t offset)
 {
        void *tmp = NULL, *overlap = NULL;
 
@@ -1835,7 +1835,7 @@ out:
        return overlap;
 }
 
-int lxc_munmap(void *addr, size_t length)
+int lxc_strmunmap(void *addr, size_t length)
 {
        return munmap(addr, length + 1);
 }
index 2c1b80fba60c93055911f6e658cf750d199a6ae0..fbd516cf6ba004a0557478a30ae0c213d33ca7a7 100644 (file)
@@ -255,10 +255,10 @@ extern void **lxc_append_null_to_array(void **array, size_t count);
 
 /* mmap() wrapper. lxc_mmap() will take care to \0-terminate files so that
  * normal string-handling functions can be used on the buffer. */
-extern void *lxc_mmap(void *addr, size_t length, int prot, int flags, int fd,
-                     off_t offset);
+extern void *lxc_strmmap(void *addr, size_t length, int prot, int flags, int fd,
+                        off_t offset);
 /* munmap() wrapper. Use it to free memory mmap()ed with lxc_mmap(). */
-extern int lxc_munmap(void *addr, size_t length);
+extern int lxc_strmunmap(void *addr, size_t length);
 
 //initialize rand with urandom
 extern int randseed(bool);