Look at /run/shm instead of /dev/shm.

Signed-off-by: Gabriel de Perthuis <g2p.c...@gmail.com>
To: Jeff Dike <jd...@addtoit.com>
To: Richard Weinberger <rich...@nod.at>
Cc: user-mode-linux-devel@lists.sourceforge.net
---
There's a TMPDIR fallback so I haven't complicated this change with a fallback 
to /dev/shm.

 arch/um/os-Linux/mem.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/um/os-Linux/mem.c b/arch/um/os-Linux/mem.c
index ba43980..11d1db7 100644
--- a/arch/um/os-Linux/mem.c
+++ b/arch/um/os-Linux/mem.c
@@ -92,18 +92,18 @@ static int next(int fd, char *buf, size_t size, char c)
 
 /* which_tmpdir is called only during early boot */
 static int checked_tmpdir = 0;
 
 /*
- * Look for a tmpfs mounted at /dev/shm.  I couldn't find a cleaner
+ * Look for a tmpfs mounted at /run/shm.  I couldn't find a cleaner
  * way to do this than to parse /proc/mounts.  statfs will return the
- * same filesystem magic number and fs id for both /dev and /dev/shm
+ * same filesystem magic number and fs id for both /run and /run/shm
  * when they are both tmpfs, so you can't tell if they are different
  * filesystems.  Also, there seems to be no other way of finding the
  * mount point of a filesystem from within it.
  *
- * If a /dev/shm tmpfs entry is found, then we switch to using it.
+ * If a /run/shm tmpfs entry is found, then we switch to using it.
  * Otherwise, we stay with the default /tmp.
  */
 static void which_tmpdir(void)
 {
        int fd, found;
@@ -112,11 +112,11 @@ static void which_tmpdir(void)
        if (checked_tmpdir)
                return;
 
        checked_tmpdir = 1;
 
-       printf("Checking for tmpfs mount on /dev/shm...");
+       printf("Checking for tmpfs mount on /run/shm...");
 
        fd = open("/proc/mounts", O_RDONLY);
        if (fd < 0) {
                printf("failed to open /proc/mounts, errno = %d\n", errno);
                return;
@@ -125,21 +125,21 @@ static void which_tmpdir(void)
        while (1) {
                found = next(fd, buf, ARRAY_SIZE(buf), ' ');
                if (found != 1)
                        break;
 
-               if (!strncmp(buf, "/dev/shm", strlen("/dev/shm")))
+               if (!strncmp(buf, "/run/shm", strlen("/run/shm")))
                        goto found;
 
                found = next(fd, buf, ARRAY_SIZE(buf), '\n');
                if (found != 1)
                        break;
        }
 
 err:
        if (found == 0)
-               printf("nothing mounted on /dev/shm\n");
+               printf("nothing mounted on /run/shm\n");
        else if (found < 0)
                printf("read returned errno %d\n", -found);
 
 out:
        close(fd);
@@ -155,11 +155,11 @@ found:
                printf("not tmpfs\n");
                goto out;
        }
 
        printf("OK\n");
-       default_tmpdir = "/dev/shm";
+       default_tmpdir = "/run/shm";
        goto out;
 }
 
 static int __init make_tempfile(const char *template, char **out_tempname,
                                int do_unlink)
-- 
1.8.3.2.736.gf6be4c2.dirty


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

Reply via email to