Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 9243
b: refs/heads/master
c: a8bfb94
h: refs/heads/master
i:
  9241: b6a1dfc
  9239: 5730213
v: v3
  • Loading branch information
Paolo 'Blaisorblade' Giarrusso authored and Linus Torvalds committed Sep 23, 2005
1 parent 0411551 commit 28305ac
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3a02d6c051cf3c214aab38e4330b4bcec5f6e3f8
refs/heads/master: a8bfb94c58238666df0d6856861d18f0f52fc752
4 changes: 3 additions & 1 deletion trunk/arch/um/include/user.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ extern void *um_kmalloc_atomic(int size);
extern void kfree(void *ptr);
extern int in_aton(char *str);
extern int open_gdb_chan(void);
extern int strlcpy(char *, const char *, int);
/* These use size_t, however unsigned long is correct on both i386 and x86_64. */
extern unsigned long strlcpy(char *, const char *, unsigned long);
extern unsigned long strlcat(char *, const char *, unsigned long);
extern void *um_vmalloc(int size);
extern void vfree(void *ptr);

Expand Down
11 changes: 4 additions & 7 deletions trunk/arch/um/kernel/umid.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,16 +237,13 @@ static int __init make_uml_dir(void)
strlcpy(dir, home, sizeof(dir));
uml_dir++;
}
strlcat(dir, uml_dir, sizeof(dir));
len = strlen(dir);
strncat(dir, uml_dir, sizeof(dir) - len);
len = strlen(dir);
if((len > 0) && (len < sizeof(dir) - 1) && (dir[len - 1] != '/')){
dir[len] = '/';
dir[len + 1] = '\0';
}
if (len > 0 && dir[len - 1] != '/')
strlcat(dir, "/", sizeof(dir));

uml_dir = malloc(strlen(dir) + 1);
if(uml_dir == NULL){
if (uml_dir == NULL) {
printf("make_uml_dir : malloc failed, errno = %d\n", errno);
exit(1);
}
Expand Down

0 comments on commit 28305ac

Please sign in to comment.