X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=arch%2Fum%2Fos-Linux%2Fmem.c;h=f1ea169db85e174cf2d6998043bce9d655eef0cd;hb=7baca6ad0ef09c8a78d798c93a3ce25336e8f50f;hp=4203681e508d0a680635347c53a2168fdd3a68be;hpb=db1a19b38f3a85f475b4ad716c71be133d8ca48e;p=powerpc.git diff --git a/arch/um/os-Linux/mem.c b/arch/um/os-Linux/mem.c index 4203681e50..f1ea169db8 100644 --- a/arch/um/os-Linux/mem.c +++ b/arch/um/os-Linux/mem.c @@ -20,7 +20,13 @@ #include +/* 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 +35,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 +90,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 +194,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 +239,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 +253,7 @@ int create_mem_file(unsigned long long len) errno = -err; perror("exec_close"); } - return(fd); + return fd; }