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>
This commit is contained in:
committed by
Linus Torvalds
parent
4d18de45fa
commit
c9a3072d13
@@ -172,13 +172,15 @@ int __init make_tempfile(const char *template, char **out_tempname,
|
||||
|
||||
which_tmpdir();
|
||||
tempname = malloc(MAXPATHLEN);
|
||||
if (!tempname)
|
||||
goto out;
|
||||
|
||||
find_tempdir();
|
||||
if (template[0] != '/')
|
||||
strcpy(tempname, tempdir);
|
||||
else
|
||||
tempname[0] = '\0';
|
||||
strcat(tempname, template);
|
||||
strncat(tempname, template, MAXPATHLEN-1-strlen(tempname));
|
||||
fd = mkstemp(tempname);
|
||||
if(fd < 0){
|
||||
fprintf(stderr, "open - cannot create %s: %s\n", tempname,
|
||||
@@ -268,6 +270,7 @@ void __init check_tmpexec(void)
|
||||
if(addr == MAP_FAILED){
|
||||
err = errno;
|
||||
perror("failed");
|
||||
close(fd);
|
||||
if(err == EPERM)
|
||||
printf("%s must be not mounted noexec\n",tempdir);
|
||||
exit(1);
|
||||
|
Reference in New Issue
Block a user