aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/os-Linux/mem.c
diff options
context:
space:
mode:
authorWANG Cong <xiyou.wangcong@gmail.com>2008-02-05 01:30:35 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-05 12:44:24 -0500
commitc9a3072d13e4b8a6549ecc1db6390a55c7ee2ddf (patch)
tree7b3eee2e8b71d844b27ed6a1c8d852915934e7f9 /arch/um/os-Linux/mem.c
parent4d18de45fa921600e1b3770c3a7cb106ab48cd9d (diff)
uml: code tidying under arch/um/os-Linux
This patch contains varied fixes and improvements for some files under arch/um/os-Linux/, such as a typo fix in a perror message, a missing argument fix for a printf, some constifying for pointers and so on. [ jdike - made sigprocmask failure return -errno instead of -1 ] Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com> Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/os-Linux/mem.c')
-rw-r--r--arch/um/os-Linux/mem.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/um/os-Linux/mem.c b/arch/um/os-Linux/mem.c
index 436f8d20b20f..c3b736adc1d9 100644
--- a/arch/um/os-Linux/mem.c
+++ b/arch/um/os-Linux/mem.c
@@ -172,13 +172,15 @@ int __init make_tempfile(const char *template, char **out_tempname,
172 172
173 which_tmpdir(); 173 which_tmpdir();
174 tempname = malloc(MAXPATHLEN); 174 tempname = malloc(MAXPATHLEN);
175 if (!tempname)
176 goto out;
175 177
176 find_tempdir(); 178 find_tempdir();
177 if (template[0] != '/') 179 if (template[0] != '/')
178 strcpy(tempname, tempdir); 180 strcpy(tempname, tempdir);
179 else 181 else
180 tempname[0] = '\0'; 182 tempname[0] = '\0';
181 strcat(tempname, template); 183 strncat(tempname, template, MAXPATHLEN-1-strlen(tempname));
182 fd = mkstemp(tempname); 184 fd = mkstemp(tempname);
183 if(fd < 0){ 185 if(fd < 0){
184 fprintf(stderr, "open - cannot create %s: %s\n", tempname, 186 fprintf(stderr, "open - cannot create %s: %s\n", tempname,
@@ -268,6 +270,7 @@ void __init check_tmpexec(void)
268 if(addr == MAP_FAILED){ 270 if(addr == MAP_FAILED){
269 err = errno; 271 err = errno;
270 perror("failed"); 272 perror("failed");
273 close(fd);
271 if(err == EPERM) 274 if(err == EPERM)
272 printf("%s must be not mounted noexec\n",tempdir); 275 printf("%s must be not mounted noexec\n",tempdir);
273 exit(1); 276 exit(1);