]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/um/os-Linux/mem.c
uml: remove user_util.h
[karo-tx-linux.git] / arch / um / os-Linux / mem.c
index 4203681e508d0a680635347c53a2168fdd3a68be..dcaca0e190de252c8e7d9a64482c9e86666e79bd 100644 (file)
@@ -11,7 +11,6 @@
 #include <sys/statfs.h>
 #include "kern_util.h"
 #include "user.h"
-#include "user_util.h"
 #include "mem_user.h"
 #include "init.h"
 #include "os.h"
 
 #include <sys/param.h>
 
+/* Modified by which_tmpdir, which is called during early boot */
 static char *default_tmpdir = "/tmp";
+
+/*
+ *  Modified when creating the physical memory file and when checking
+ * the tmp filesystem for usability, both happening during early boot.
+ */
 static char *tempdir = NULL;
 
 static void __init find_tempdir(void)
@@ -29,7 +34,8 @@ static void __init find_tempdir(void)
        int i;
        char *dir = NULL;
 
-       if(tempdir != NULL) return;     /* We've already been called */
+       if(tempdir != NULL) /* We've already been called */
+               return;
        for(i = 0; dirs[i]; i++){
                dir = getenv(dirs[i]);
                if((dir != NULL) && (*dir != '\0'))
@@ -83,6 +89,7 @@ static int next(int fd, char *buf, int size, char c)
        return 1;
 }
 
+/* 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
@@ -186,7 +193,7 @@ int make_tempfile(const char *template, char **out_tempname, int do_unlink)
        } else {
                free(tempname);
        }
-       return(fd);
+       return fd;
 out:
        free(tempname);
        return -1;
@@ -231,7 +238,7 @@ int create_tmp_file(unsigned long long len)
                exit(1);
        }
 
-       return(fd);
+       return fd;
 }
 
 int create_mem_file(unsigned long long len)
@@ -245,7 +252,7 @@ int create_mem_file(unsigned long long len)
                errno = -err;
                perror("exec_close");
        }
-       return(fd);
+       return fd;
 }