git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
arch
/
um
/
kernel
/
exitcode.c
diff --git
a/arch/um/kernel/exitcode.c
b/arch/um/kernel/exitcode.c
index
14a748e
..
8b7f2cd
100644
(file)
--- a/
arch/um/kernel/exitcode.c
+++ b/
arch/um/kernel/exitcode.c
@@
-16,9
+16,13
@@
int uml_exitcode = 0;
static int read_proc_exitcode(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
static int read_proc_exitcode(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
- int len;
+ int len
, val
;
- len = sprintf(page, "%d\n", uml_exitcode);
+ /* Save uml_exitcode in a local so that we don't need to guarantee
+ * that sprintf accesses it atomically.
+ */
+ val = uml_exitcode;
+ len = sprintf(page, "%d\n", val);
len -= off;
if(len <= off+count) *eof = 1;
*start = page + off;
len -= off;
if(len <= off+count) *eof = 1;
*start = page + off;
@@
-27,7
+31,7
@@
static int read_proc_exitcode(char *page, char **start, off_t off,
return(len);
}
return(len);
}
-static int write_proc_exitcode(struct file *file, const char *buffer,
+static int write_proc_exitcode(struct file *file, const char
__user
*buffer,
unsigned long count, void *data)
{
char *end, buf[sizeof("nnnnn\0")];
unsigned long count, void *data)
{
char *end, buf[sizeof("nnnnn\0")];
@@
-48,7
+52,7
@@
static int make_proc_exitcode(void)
ent = create_proc_entry("exitcode", 0600, &proc_root);
if(ent == NULL){
ent = create_proc_entry("exitcode", 0600, &proc_root);
if(ent == NULL){
- printk("make_proc_exitcode : Failed to register "
+ printk(
KERN_WARNING
"make_proc_exitcode : Failed to register "
"/proc/exitcode\n");
return(0);
}
"/proc/exitcode\n");
return(0);
}